mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
parent
2d03e1280a
commit
0a9df3af52
31
ui/core.js
31
ui/core.js
@ -28,6 +28,7 @@
|
||||
"./keycode",
|
||||
"./labels",
|
||||
"./jquery-1-7",
|
||||
"./plugin",
|
||||
"./version"
|
||||
], factory );
|
||||
} else {
|
||||
@ -125,34 +126,4 @@ $.extend( $.expr[ ":" ], {
|
||||
}
|
||||
} );
|
||||
|
||||
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
|
||||
$.ui.plugin = {
|
||||
add: function( module, option, set ) {
|
||||
var i,
|
||||
proto = $.ui[ module ].prototype;
|
||||
for ( i in set ) {
|
||||
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
||||
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
||||
}
|
||||
},
|
||||
call: function( instance, name, args, allowDisconnected ) {
|
||||
var i,
|
||||
set = instance.plugins[ name ];
|
||||
|
||||
if ( !set ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for ( i = 0; i < set.length; i++ ) {
|
||||
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
||||
set[ i ][ 1 ].apply( instance.element, args );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} ) );
|
||||
|
@ -23,6 +23,7 @@
|
||||
"./core",
|
||||
"./data",
|
||||
"./mouse",
|
||||
"./plugin",
|
||||
"./version",
|
||||
"./widget"
|
||||
], factory );
|
||||
|
43
ui/plugin.js
Normal file
43
ui/plugin.js
Normal file
@ -0,0 +1,43 @@
|
||||
( function( factory ) {
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery", "./version" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} ( function( $ ) {
|
||||
|
||||
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
|
||||
return $.ui.plugin = {
|
||||
add: function( module, option, set ) {
|
||||
var i,
|
||||
proto = $.ui[ module ].prototype;
|
||||
for ( i in set ) {
|
||||
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
||||
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
||||
}
|
||||
},
|
||||
call: function( instance, name, args, allowDisconnected ) {
|
||||
var i,
|
||||
set = instance.plugins[ name ];
|
||||
|
||||
if ( !set ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for ( i = 0; i < set.length; i++ ) {
|
||||
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
||||
set[ i ][ 1 ].apply( instance.element, args );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} ) );
|
@ -22,9 +22,9 @@
|
||||
// AMD. Register as an anonymous module.
|
||||
define([
|
||||
"jquery",
|
||||
"./core",
|
||||
"./disable-selection",
|
||||
"./mouse",
|
||||
"./plugin",
|
||||
"./version",
|
||||
"./widget"
|
||||
], factory );
|
||||
|
Loading…
Reference in New Issue
Block a user