mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Display topics and content types in filters header on load page with selected filters (#6446)
This commit is contained in:
parent
53eec3edf6
commit
a7fc6f9dd5
@ -10,6 +10,7 @@ HumHub Changelog
|
||||
- Fix #6377: Forgot Password - Display email input error after successful captcha verification.
|
||||
- Fix #6378: Fix visibility of the link "Uninstall" on Windows server
|
||||
- Fix #6404: Fix visibility of global content on dashboard for registered users
|
||||
- Fix #6441: Display topics and content types in filters header on load page with selected filters
|
||||
|
||||
1.14.2 (May 22, 2023)
|
||||
----------------------
|
||||
|
@ -299,32 +299,34 @@ humhub.module('stream.wall', function (module, require, $) {
|
||||
};
|
||||
|
||||
WallStreamFilter.prototype.initTopicPicker = function() {
|
||||
var that = this;
|
||||
var topicPicker = this.getTopicPicker();
|
||||
if(topicPicker) {
|
||||
topicPicker.$.on('change', function() {
|
||||
var topics = [];
|
||||
$.each(that.getTopicPicker().map(), function(key, value) {
|
||||
const topicPicker = this.getTopicPicker();
|
||||
if (topicPicker) {
|
||||
const updateFilterBar = function () {
|
||||
const topics = [];
|
||||
$.each(topicPicker.map(), function(key, value) {
|
||||
topics.push({id:key, name: value})
|
||||
});
|
||||
|
||||
// Note the stream init is triggered by the humhub:topic:updated event
|
||||
topic.setTopics(topics);
|
||||
});
|
||||
}
|
||||
topicPicker.on('afterInitSelect2', updateFilterBar)
|
||||
.$.on('change', updateFilterBar);
|
||||
}
|
||||
};
|
||||
|
||||
WallStreamFilter.prototype.initContentTypePicker = function() {
|
||||
var that = this;
|
||||
var contentTypePicker = this.getContentTypePicker();
|
||||
if(contentTypePicker) {
|
||||
contentTypePicker.$.on('change', function() {
|
||||
var $filterBar = that.getFilterBar();
|
||||
const that = this;
|
||||
const contentTypePicker = this.getContentTypePicker();
|
||||
if (contentTypePicker) {
|
||||
const updateFilterBar = function () {
|
||||
const $filterBar = that.getFilterBar();
|
||||
$filterBar.find('.content-type-remove-label').remove();
|
||||
Widget.instance($(this)).data().forEach(function(contentType) {
|
||||
contentTypePicker.data().forEach(function(contentType) {
|
||||
$(string.template(WallStreamFilter.template.removeContentTypeLabel, contentType)).appendTo($filterBar);
|
||||
});
|
||||
});
|
||||
}
|
||||
contentTypePicker.on('afterInitSelect2', updateFilterBar)
|
||||
.$.on('change', updateFilterBar);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -170,6 +170,8 @@ humhub.module('ui.picker', function (module, require, $) {
|
||||
if ($node.data('picker-focus')) {
|
||||
Widget.instance($node).focus();
|
||||
}
|
||||
|
||||
Widget.instance($node).fire('afterInitSelect2');
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user