Permalink
Browse files

adjacency methods (append, prepend, before, after) can now take a Zep…

…to object as the parameter
  • Loading branch information...
1 parent 5ecaa12 commit a767cc9cc9fdd948221cdb0539d0369f4b6dbd37 @drewlesueur drewlesueur committed Dec 18, 2010
Showing with 4 additions and 6 deletions.
  1. +1 −6 README.rdoc
  2. +3 −0 src/zepto.js
View
@@ -54,7 +54,7 @@ Context and .find calls are equivalent:
html('new html'): set the contents of the element(s)
text('new text'): set the text contents of the element(s)
- append, prepend, before, after: like html, but add html to element contents (or before/after)
+ append, prepend, before, after: like html(), but add html (or a DOM Element or a Zepto object) to element contents (or before/after)
html(): get first element's .innerHTML
text(): get first element's .innerText
show(): forces elements to be displayed (only works correctly for block elements right now)
@@ -134,18 +134,13 @@ Double-tapping:
Swiping (e.g. "delete" button when swiping over a list entry):
$('some selector').swipe(function(){ ... });
-<<<<<<< HEAD
-=======
Swiping left:
$('some selector').swipeLeft(function(){ ... });
Swiping right:
$('some selector').swipeRight(function(){ ... });
-= Ajax:
->>>>>>> 1182eedd3d59aec75b173b8723428439382b1cfe
-
= Ajax
Simple GET and POST:
View
@@ -142,6 +142,9 @@ var Zepto = (function() {
$.fn[key] = (function(operator) {
return function(html){
return this.each(function(element){
+ if (html instanceof Z && html.dom[0]) {
+ html = html.dom[0]
+ }
element['insertAdjacent' + (html instanceof Element ? 'Element' : 'HTML')](operator, html);
});
};

0 comments on commit a767cc9

Please sign in to comment.