Fix: UI addition mutation observer interfering with new rich-text mutation logic

This commit is contained in:
buddh4 2018-07-06 22:37:33 +02:00
parent 6d803246ec
commit be8a89e01e
3 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ HumHub Change Log
1.3.0-beta.2 (Unreleased)
--------------------------
- Enh: Added CounterSet Widget to handle Space/Profile header statistic counts
- Fix: UI addition mutation observer interfering with new rich-text mutation logic
1.3.0-beta.1 (July 4, 2018)

View File

@ -19,7 +19,6 @@ humhub.module('comment', function (module, require, $) {
that.addComment(response.html);
that.getInput().val('').trigger('autosize.resize');
richText.$.trigger('clear');
//richText.focus();
that.getUpload().reset();
}).catch(function (err) {
module.log.error(err, true);
@ -224,6 +223,7 @@ humhub.module('comment', function (module, require, $) {
var toggleComment = function(evt) {
var visible = evt.$target.is(':visible');
evt.$target.slideToggle(undefined, function() {
debugger;
evt.$target.find('.humhub-ui-richtext').trigger('focus');
});
};

View File

@ -239,7 +239,7 @@ humhub.module('ui.additions', function (module, require, $) {
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
var $nodes = $(mutation.addedNodes).filter(function () {
return this.nodeType === 1; // filter out text nodes
return this.nodeType === 1 && !$(this).closest('.humhub-ui-richtext').length; // filter out text nodes and ignore richtext changes
});
$nodes.each(function () {