Skip to content

Commit

Permalink
#3 support new widget namespace prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
javadoug committed May 14, 2014
1 parent b39441b commit cad1fa4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 11 additions & 5 deletions libs/jquery-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function() {

var i, out, isJs, isCss, path, paths;
var i, out, isUi, isJs, isCss, path, paths;

paths = ['libs/jquery/jquery-ui.css', 'libs/jquery/jquery.js', 'libs/jquery/jquery-ui.js'];

Expand All @@ -11,20 +11,26 @@

path = paths[i];

isUi = /-ui/i.test(path);
isJs = !(isCss = /\.css/i.test(path));

// http://code.jquery.com/jquery-2.1.1.min.js
if (jqversion && isJs) {
path = 'http://code.jquery.com/jquery-' + jqversion[1] + '.js';
}

if (uiversion && isJs) {
path = 'http://code.jquery.com/jquery-ui-' + uiversion[1] + '.js';
// http://code.jquery.com/ui/1.10.4/jquery-ui.min.js
if (isUi && uiversion && isJs) {
path = 'http://code.jquery.com/ui/' + uiversion[1] + '/jquery-ui.js';
}

if (uiversion && isCss) {
path = 'http://code.jquery.com/jquery-ui-' + uiversion[1] + '.css';
// http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css
if (isUi && uiversion && isCss) {
path = 'http://code.jquery.com/ui/' + uiversion[1] + '/themes/smoothness/jquery-ui.css';
}

console.log('path is %s', path);

if (isCss) {
out = '<link rel="stylesheet" href="' + path + '">';
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/drag-multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
element = this;

// the draggable instance
instance = element.data('draggable');
instance = element.data('draggable') || element.data('ui-draggable');

// initialize state
instance.multiple = {};
Expand Down Expand Up @@ -102,7 +102,7 @@
var element, instance, options;

element = this;
instance = element.data('draggable');
instance = element.data('draggable') || element.data('ui-draggable');
options = instance.multiple.options;

if (options.dragCanceled) {
Expand Down Expand Up @@ -134,7 +134,7 @@
var element, instance, options;

element = this;
instance = element.data('draggable');
instance = element.data('draggable') || element.data('ui-draggable');
options = instance.multiple.options;

if (options.dragCanceled) {
Expand Down

0 comments on commit cad1fa4

Please sign in to comment.