Fix #2912: Deleting single stream item does not reload stream

This commit is contained in:
buddh4 2018-10-23 15:11:09 +02:00
parent 8daedb2b44
commit f385e0cd5d
3 changed files with 14 additions and 7 deletions

View File

@ -11,6 +11,7 @@ HumHub Change Log
- Fix: Fixed typo in space (un-)archived activities
- Enh: Removed ErrorEvent which will be removed in yii-queue 3.0 (@acs-ferreira)
- Enh: Added config option to remove "user profile posts" entry from directory navigation
- Fix #2912: Deleting single stream item does not reload stream
1.3.6 (October 11, 2018)

View File

@ -221,7 +221,7 @@ humhub.module('comment', function (module, require, $) {
};
var scrollActive = function(evt) {
evt.$trigger.closest('.comment-create-input-group').addClass('scrollActive')
evt.$trigger.closest('.comment-create-input-group').addClass('scrollActive');
};
var scrollInactive = function(evt) {

View File

@ -415,7 +415,11 @@ humhub.module('stream.Stream', function (module, require, $) {
this.$.find('.streamMessage').remove();
if (!hasEntries) {
if(!hasEntries && this.isShowSingleEntry()) {
// e.g. after content deletion in single entry stream
var that = this;
setTimeout(function() {that.init()}, 50);
} else if (!hasEntries) {
this.onEmptyStream();
} else if (this.isShowSingleEntry()) {
this.onSingleEntryStream();
@ -426,16 +430,18 @@ humhub.module('stream.Stream', function (module, require, $) {
Stream.prototype.hasFilter = function (filter) {
return this.filter.hasFilter(filter);
}
};
Stream.prototype.onEmptyStream = function () {
var hasActiveFilters = this.hasActiveFilters();
this.$.find('.streamMessage').remove();
this.$content.append(string.template(this.static('templates').streamMessage, {
message: (hasActiveFilters) ? this.options.streamEmptyFilterMessage : this.options.streamEmptyMessage,
cssClass: (hasActiveFilters) ? this.options.streamEmptyFilterClass : this.options.streamEmptyClass,
}));
if(!this.isShowSingleEntry()) {
this.$content.append(string.template(this.static('templates').streamMessage, {
message: (hasActiveFilters) ? this.options.streamEmptyFilterMessage : this.options.streamEmptyMessage,
cssClass: (hasActiveFilters) ? this.options.streamEmptyFilterClass : this.options.streamEmptyClass,
}));
}
if(!hasActiveFilters) {
this.filter.hide();