prototype: Element#wrap now returns the wrapper instead of the element being wrapped.
This commit is contained in:
parent
115d3e456d
commit
4607e29fa2
@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Element#wrap now returns the wrapper instead of the element being wrapped. [sam]
|
||||
|
||||
* Namespace all custom event names to avoid conflicts with native DOM events. [sam]
|
||||
- All custom event names MUST include a namespace. Prefix custom event names for observe, stopObserving, and fire with the namespace followed by a colon. E.g. document.fire("widget:activated")
|
||||
- The "contentloaded" event is now "dom:loaded".
|
||||
|
@ -153,7 +153,7 @@ Element.Methods = {
|
||||
if (element.parentNode)
|
||||
element.parentNode.replaceChild(wrapper, element);
|
||||
wrapper.appendChild(element);
|
||||
return element;
|
||||
return wrapper;
|
||||
},
|
||||
|
||||
inspect: function(element) {
|
||||
|
@ -569,6 +569,13 @@
|
||||
assertEqual(orphan.parentNode, div);
|
||||
}},
|
||||
|
||||
testElementWrapReturnsWrapper: function() {with(this) {
|
||||
var element = new Element("div");
|
||||
var wrapper = element.wrap("div");
|
||||
assertNotEqual(element, wrapper);
|
||||
assertEqual(element.up(), wrapper);
|
||||
}},
|
||||
|
||||
testElementVisible: function(){with(this) {
|
||||
assertNotEqual('none', $('test-visible').style.display);
|
||||
assertEqual('none', $('test-hidden').style.display);
|
||||
|
Loading…
Reference in New Issue
Block a user