mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
base implementation for #4957 - still need to port users of $.ui.element
This commit is contained in:
parent
1d560a53b5
commit
f37da0e6ce
26
ui/jquery.ui.core.js
vendored
26
ui/jquery.ui.core.js
vendored
@ -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;
|
||||
})));
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user