make jquery ui a r.js module

v1.18.x
pichalite 9 years ago
parent 11be46ec23
commit 3ef7c57a63

@ -1,7 +1,7 @@
"use strict"; "use strict";
/* global define, app, ajaxify, socket, templates */ /* 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 = {}, var navigation = {},
available; available;
@ -13,22 +13,17 @@ define('admin/general/navigation', ['translator', 'iconSelect'], function(transl
}); });
translator.translate(translator.unescape($('#available').html()), function(html) { translator.translate(translator.unescape($('#available').html()), function(html) {
app.loadJQueryUI(function() { $('#available').html(html)
$('#available').html(html) .find('li .drag-item').draggable({
.find('li .drag-item').draggable({ connectToSortable: '#active-navigation',
connectToSortable: '#active-navigation', helper: 'clone',
helper: 'clone', distance: 10,
distance: 10, stop: drop
stop: drop });
});
});
}); });
app.loadJQueryUI(function() { $('#active-navigation').sortable().droppable({
accept: $('#available li .drag-item')
$('#active-navigation').sortable().droppable({
accept: $('#available li .drag-item')
});
}); });
$('#enabled').on('click', '.iconPicker', function() { $('#enabled').on('click', '.iconPicker', function() {

@ -2,14 +2,12 @@
/*globals define*/ /*globals define*/
define('admin/modules/selectable', function() { define('admin/modules/selectable', ['jqueryui'], function(jqueryui) {
var selectable = {}; var selectable = {};
selectable.enable = function(containerEl, targets) { selectable.enable = function(containerEl, targets) {
app.loadJQueryUI(function() { $(containerEl).selectable({
$(containerEl).selectable({ filter: targets
filter: targets
});
}); });
}; };

@ -80,7 +80,7 @@ module.exports = function(Meta) {
modules: { modules: {
"Chart.js": './node_modules/chart.js/dist/Chart.min.js', "Chart.js": './node_modules/chart.js/dist/Chart.min.js',
"mousetrap.js": './node_modules/mousetrap/mousetrap.js', "mousetrap.js": './node_modules/mousetrap/mousetrap.js',
"jqueryui.js": 'public/vendor/jquery/js/jquery-ui.js',
"buzz.js": 'public/vendor/buzz/buzz.js' "buzz.js": 'public/vendor/buzz/buzz.js'
} }
} }

Loading…
Cancel
Save