mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
make jquery ui a r.js module
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
/* global define, app, ajaxify, socket, templates */
|
||||
|
||||
define('admin/general/navigation', ['translator', 'iconSelect'], function(translator, iconSelect) {
|
||||
define('admin/general/navigation', ['translator', 'iconSelect', 'jqueryui'], function(translator, iconSelect, jqueryui) {
|
||||
var navigation = {},
|
||||
available;
|
||||
|
||||
@@ -13,7 +13,6 @@ define('admin/general/navigation', ['translator', 'iconSelect'], function(transl
|
||||
});
|
||||
|
||||
translator.translate(translator.unescape($('#available').html()), function(html) {
|
||||
app.loadJQueryUI(function() {
|
||||
$('#available').html(html)
|
||||
.find('li .drag-item').draggable({
|
||||
connectToSortable: '#active-navigation',
|
||||
@@ -22,14 +21,10 @@ define('admin/general/navigation', ['translator', 'iconSelect'], function(transl
|
||||
stop: drop
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
app.loadJQueryUI(function() {
|
||||
|
||||
$('#active-navigation').sortable().droppable({
|
||||
accept: $('#available li .drag-item')
|
||||
});
|
||||
});
|
||||
|
||||
$('#enabled').on('click', '.iconPicker', function() {
|
||||
var iconEl = $(this).find('i');
|
||||
|
||||
@@ -2,15 +2,13 @@
|
||||
|
||||
/*globals define*/
|
||||
|
||||
define('admin/modules/selectable', function() {
|
||||
define('admin/modules/selectable', ['jqueryui'], function(jqueryui) {
|
||||
var selectable = {};
|
||||
|
||||
selectable.enable = function(containerEl, targets) {
|
||||
app.loadJQueryUI(function() {
|
||||
$(containerEl).selectable({
|
||||
filter: targets
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return selectable;
|
||||
|
||||
@@ -80,7 +80,7 @@ module.exports = function(Meta) {
|
||||
modules: {
|
||||
"Chart.js": './node_modules/chart.js/dist/Chart.min.js',
|
||||
"mousetrap.js": './node_modules/mousetrap/mousetrap.js',
|
||||
|
||||
"jqueryui.js": 'public/vendor/jquery/js/jquery-ui.js',
|
||||
"buzz.js": 'public/vendor/buzz/buzz.js'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user