Merge branch 'master' into develop

This commit is contained in:
Lucas Bartholemy 2023-10-25 18:17:22 +02:00
commit 2c78039217
2 changed files with 9 additions and 7 deletions

View File

@ -7,6 +7,7 @@ HumHub Changelog
- Fix #6595: Fix mimetype of converted preview svg file to png after uploading
- Fix #6614: Fix undefined error on live event of follow action
- Fix #6615: Improve scrolling to anchor with fixed header
- Fix #6629: Fix visibility of new message counter on space chooser
1.14.4 (September 20, 2023)
---------------------------

View File

@ -46,6 +46,7 @@ humhub.module('space.chooser', function (module, require, $) {
this.initEvents();
this.initSpaceSearch();
this.initMessageCounters();
};
SpaceChooser.prototype.initEvents = function () {
@ -53,13 +54,6 @@ humhub.module('space.chooser', function (module, require, $) {
var that = this;
$('[data-space-guid]').find('[data-message-count]').each(function () {
var $this = $(this);
if ($this.data('message-count') > 0) {
$this.show();
}
});
// Forward click events to actual link
this.$.on('click', SELECTOR_ITEM, function (evt) {
if (this === evt.target) {
@ -100,6 +94,12 @@ humhub.module('space.chooser', function (module, require, $) {
});
};
SpaceChooser.prototype.initMessageCounters = function () {
$('[data-space-guid] [data-message-count]').each(function () {
$(this).toggle($(this).data('message-count') > 0);
});
}
SpaceChooser.prototype.handleNewContent = function (liveEvents) {
var that = this;
var increments = {};
@ -276,6 +276,7 @@ humhub.module('space.chooser', function (module, require, $) {
that.appendItem(space);
});
that.initMessageCounters();
that.highlight(input, SELECTOR_ITEM_REMOTE);
that.onChange(input);