Skip to content

Commit

Permalink
a few changes to increase jQuery compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Escobar committed Aug 18, 2013
1 parent 0fa0b8d commit 52f707f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/zepto.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,15 +539,15 @@ var Zepto = (function() {
prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },
next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },
html: function(html){
return html === undefined ?
return arguments.length === 0 ?
(this.length > 0 ? this[0].innerHTML : null) :
this.each(function(idx){
var originHtml = this.innerHTML
$(this).empty().append( funcArg(this, html, idx, originHtml) )
})
},
text: function(text){
return text === undefined ?
return arguments.length === 0 ?
(this.length > 0 ? this[0].textContent : null) :
this.each(function(){ this.textContent = text })
},
Expand Down Expand Up @@ -579,7 +579,7 @@ var Zepto = (function() {
return data !== null ? deserializeValue(data) : undefined
},
val: function(value){
return (value === undefined) ?
return arguments.length === 0 ?
(this[0] && (this[0].multiple ?
$(this[0]).find('option').filter(function(o){ return this.selected }).pluck('value') :
this[0].value)
Expand Down

0 comments on commit 52f707f

Please sign in to comment.