From 7f3c58a0228b451d0a43a1c5aea6b81e72290aa9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 8 Feb 2019 09:50:06 -0500 Subject: [PATCH] fix: nodebb/nodebb#7345, textcomplete for Persona QR --- lib/modules/quickreply.js | 21 +++++++++++++-------- package.json | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/modules/quickreply.js b/lib/modules/quickreply.js index f87aaeb..2ac6df7 100644 --- a/lib/modules/quickreply.js +++ b/lib/modules/quickreply.js @@ -2,7 +2,7 @@ /*globals $, app, ajaxify, socket*/ -define('persona/quickreply', ['components'], function(components) { +define('persona/quickreply', ['components', 'composer/autocomplete'], function(components, autocomplete) { var QuickReply = {}; QuickReply.init = function() { @@ -12,18 +12,21 @@ define('persona/quickreply', ['components'], function(components) { element: element, strategies: [], options: { - zIndex: 100, - listPosition: function(position) { - this.$el.css(this._applyPlacement(position)); - this.$el.css('position', 'absolute'); - return this; + style: { + 'z-index': 100, } + // listPosition: function(position) { + // this.$el.css(this._applyPlacement(position)); + // this.$el.css('position', 'absolute'); + // return this; + // } } }; $(window).trigger('composer:autocomplete:init', data); - data.element.textcomplete(data.strategies, data.options); - $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%'); + autocomplete._active['persona_qr'] = autocomplete.setup(data); + // data.element.textcomplete(data.strategies, data.options); + // $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%'); components.get('topic/quickreply/button').on('click', function(e) { e.preventDefault(); @@ -41,7 +44,9 @@ define('persona/quickreply', ['components'], function(components) { if (data && data.queued) { app.alertSuccess(data.message); } + components.get('topic/quickreply/text').val(''); + autocomplete._active['persona_qr'].hide(); }); }); }; diff --git a/package.json b/package.json index be5081b..137d243 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nodebb-theme-persona", "version": "9.1.15", "nbbpm": { - "compatibility": "^1.11.0" + "compatibility": "^1.12.0" }, "description": "Persona theme for NodeBB", "main": "theme.less",