mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: closes #12807, fix quick reply js error
This commit is contained in:
@@ -8,7 +8,7 @@ define('quickreply', [
|
|||||||
alerts, uploadHelpers, mousetrap, storage, hooks
|
alerts, uploadHelpers, mousetrap, storage, hooks
|
||||||
) {
|
) {
|
||||||
const QuickReply = {
|
const QuickReply = {
|
||||||
_active: {},
|
_autocomplete: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
QuickReply.init = function () {
|
QuickReply.init = function () {
|
||||||
@@ -29,7 +29,7 @@ define('quickreply', [
|
|||||||
destroyAutoComplete();
|
destroyAutoComplete();
|
||||||
});
|
});
|
||||||
$(window).trigger('composer:autocomplete:init', data);
|
$(window).trigger('composer:autocomplete:init', data);
|
||||||
QuickReply._active.core_qr = autocomplete.setup(data);
|
QuickReply._autocomplete = autocomplete.setup(data);
|
||||||
|
|
||||||
mousetrap.bind('ctrl+return', (e) => {
|
mousetrap.bind('ctrl+return', (e) => {
|
||||||
if (e.target === element.get(0)) {
|
if (e.target === element.get(0)) {
|
||||||
@@ -92,7 +92,7 @@ define('quickreply', [
|
|||||||
|
|
||||||
components.get('topic/quickreply/text').val('');
|
components.get('topic/quickreply/text').val('');
|
||||||
storage.removeItem(qrDraftId);
|
storage.removeItem(qrDraftId);
|
||||||
autocomplete._active.core_qr.hide();
|
QuickReply._autocomplete.hide();
|
||||||
hooks.fire('action:quickreply.success', { data });
|
hooks.fire('action:quickreply.success', { data });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -125,9 +125,9 @@ define('quickreply', [
|
|||||||
};
|
};
|
||||||
|
|
||||||
function destroyAutoComplete() {
|
function destroyAutoComplete() {
|
||||||
if (QuickReply._active.core_qr) {
|
if (QuickReply._autocomplete) {
|
||||||
QuickReply._active.core_qr.destroy();
|
QuickReply._autocomplete.destroy();
|
||||||
QuickReply._active.core_qr = null;
|
QuickReply._autocomplete = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user