aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.core.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-03-08 10:23:25 -0500
committerScott González <scott.gonzalez@gmail.com>2013-03-08 10:23:25 -0500
commite0b2644d91ffb8b59f9cf6d8ac8b45f94af7dacd (patch)
tree796948406d2ef535f1fc762a81c420bed248f4ed /ui/jquery.ui.core.js
parentcdff72efed495d7a17c551578079619712758793 (diff)
downloadjquery-ui-e0b2644d91ffb8b59f9cf6d8ac8b45f94af7dacd.tar.gz
jquery-ui-e0b2644d91ffb8b59f9cf6d8ac8b45f94af7dacd.zip
Removed guard against duplicate loading. Use safe references to original functions when proxying, don't rename originals.
Diffstat (limited to 'ui/jquery.ui.core.js')
-rw-r--r--ui/jquery.ui.core.js36
1 files changed, 16 insertions, 20 deletions
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js
index d224f181a..1a13da251 100644
--- a/ui/jquery.ui.core.js
+++ b/ui/jquery.ui.core.js
@@ -13,13 +13,8 @@
var uuid = 0,
runiqueId = /^ui-id-\d+$/;
-// prevent duplicate loading
-// this is only a problem because we proxy existing functions
-// and we don't want to double proxy them
+// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
-if ( $.ui.version ) {
- return;
-}
$.extend( $.ui, {
version: "@VERSION",
@@ -52,20 +47,21 @@ $.extend( $.ui, {
// plugins
$.fn.extend({
- _focus: $.fn.focus,
- focus: function( delay, fn ) {
- return typeof delay === "number" ?
- this.each(function() {
- var elem = this;
- setTimeout(function() {
- $( elem ).focus();
- if ( fn ) {
- fn.call( elem );
- }
- }, delay );
- }) :
- this._focus.apply( this, arguments );
- },
+ focus: (function( orig ) {
+ return function( delay, fn ) {
+ return typeof delay === "number" ?
+ this.each(function() {
+ var elem = this;
+ setTimeout(function() {
+ $( elem ).focus();
+ if ( fn ) {
+ fn.call( elem );
+ }
+ }, delay );
+ }) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.focus ),
scrollParent: function() {
var scrollParent;