Skip to content
Permalink
Browse files

base implementation for #4957 - still need to port users of $.ui.element

  • Loading branch information
jzaefferer committed Jan 20, 2010
1 parent 1d560a5 commit f37da0e6ce09615060f4562fe6fbc0361daf6772
Showing with 26 additions and 0 deletions.
  1. +26 −0 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;
})));
}
});

0 comments on commit f37da0e

Please sign in to comment.
You can’t perform that action at this time.