From 02a8ed9b11938a70e9f991cc215d0d94462cddfa Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 28 Jan 2019 13:05:25 -0500 Subject: [PATCH] feat: textcomplete over jquery-textcomplete, closes #7309 --- install/package.json | 2 +- public/src/client/chats.js | 15 ++++++++------- src/meta/js.js | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/install/package.json b/install/package.json index a8d39bb90d..480dbf27b0 100644 --- a/install/package.json +++ b/install/package.json @@ -80,7 +80,7 @@ "mousetrap": "^1.6.1", "mubsub-nbb": "^1.5.0", "nconf": "^0.10.0", - "nodebb-plugin-composer-default": "6.1.21", + "nodebb-plugin-composer-default": "6.2.0", "nodebb-plugin-dbsearch": "3.0.6", "nodebb-plugin-emoji": "^2.2.5", "nodebb-plugin-emoji-android": "2.0.0", diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 861306f8f4..5ffa05f4a4 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -9,7 +9,8 @@ define('forum/chats', [ 'forum/chats/search', 'forum/chats/messages', 'benchpress', -], function (components, translator, mousetrap, recentChats, search, messages, Benchpress) { + 'composer/autocomplete', +], function (components, translator, mousetrap, recentChats, search, messages, Benchpress, autocomplete) { var Chats = { initialised: false, }; @@ -361,18 +362,18 @@ define('forum/chats', [ element: element, strategies: [], options: { - zIndex: 20000, - listPosition: function (position) { - this.$el.css(this._applyPlacement(position)); - this.$el.css('position', 'absolute'); - return this; + style: { + 'z-index': 20000, + flex: 0, + top: 'inherit', }, + placement: 'top', }, }; $(window).trigger('chat:autocomplete:init', data); if (data.strategies.length) { - data.element.textcomplete(data.strategies, data.options); + autocomplete.setup(data); } }; diff --git a/src/meta/js.js b/src/meta/js.js index b59167718d..dd6ab20e6e 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -17,12 +17,13 @@ JS.scripts = { 'node_modules/promise-polyfill/dist/polyfill.js', 'node_modules/jquery/dist/jquery.js', 'node_modules/socket.io-client/dist/socket.io.js', + 'node_modules/textcomplete/dist/textcomplete.min.js', + 'node_modules/textcomplete.contenteditable/dist/textcomplete.codemirror.min.js', 'public/vendor/jquery/timeago/jquery.timeago.js', 'public/vendor/jquery/js/jquery.form.min.js', 'public/vendor/visibility/visibility.min.js', 'node_modules/bootstrap/dist/js/bootstrap.js', 'public/vendor/jquery/bootstrap-tagsinput/bootstrap-tagsinput.min.js', - 'public/vendor/jquery/textcomplete/jquery.textcomplete.js', 'public/vendor/requirejs/require.js', 'public/src/require-config.js', 'public/vendor/bootbox/bootbox.js',