diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2010-01-20 18:10:07 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2010-01-20 18:10:07 +0000 |
commit | f37da0e6ce09615060f4562fe6fbc0361daf6772 (patch) | |
tree | 2dcd8198b8a0eac7a77a69d26d9d54bcbfb17379 /ui/jquery.ui.core.js | |
parent | 1d560a53b55c6ae34fced9e7fda3ba5ee2aa725c (diff) | |
download | jquery-ui-f37da0e6ce09615060f4562fe6fbc0361daf6772.tar.gz jquery-ui-f37da0e6ce09615060f4562fe6fbc0361daf6772.zip |
base implementation for #4957 - still need to port users of $.ui.element
Diffstat (limited to 'ui/jquery.ui.core.js')
-rw-r--r-- | ui/jquery.ui.core.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 28cf9075b..4290dc521 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -98,6 +98,26 @@ $.ui = { SPACE: 32, TAB: 9, UP: 38 + }, + + element: function(value, context) { + var ret = $([]); // $(context) ? + + if (value.jquery) { + ret = value; + } else if (value == 'parent') { + ret = $(context).parent(); + } else if (value == 'clone') { + ret = $(context).clone().removeAttr('id'); + } else if (value == 'window') { + ret = $(context).window(); // requires .window() plugin + } else if (value.nodeType || typeof value == 'string' || $.isArray(value)) { + ret = $(value, context); + } else if ($.isFunction(value)) { + ret = value(context); + } + + return ret; } }; @@ -194,6 +214,12 @@ $.fn.extend({ } return 0; + }, + + window: function() { + return this.pushStack($.unique($.map(this, function() { + return this.ownerDocument.defaultView; + }))); } }); |