Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
.toggle and .hide/.show now return to the previous display style inst…
…ead of just block/none (Thanks hackernews)

New images for kitchensink (optimized).
  • Loading branch information
Ian Maffett committed Jan 16, 2012
1 parent 40b6c28 commit 94facc1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
23 changes: 20 additions & 3 deletions jq.mobi.js
Expand Up @@ -204,14 +204,31 @@ var jq = (function () {
return this;
},
hide: function () {
return this.css("display", "none");
if(this.length==0) return null;
for(var i=0;i<this.length;i++){
this[i]['data-jqm-old-style']=this[i].style['display'];
this[i].style['display']="none";
}
return this;
},
show: function () {
return this.css("display", "block");
if(this.length==0) return null;
for(var i=0;i<this.length;i++){
this[i].style['display']=this[i]['data-jqm-old-style']!=null?this[i]['data-jqm-old-style']:'block';
delete this[i]['data-jqm-old-style'];
}
return this;
},
toggle: function () {
for (var i = 0; i < this.length; i++) {
this[0].style.display = this[0].style.display == "none" ? "block" : "none";
if(this[i].style['display']!="none"){
this[i]['data-jqm-old-style']=this[i].style['display'];
this[i].style['display']="none";
}
else {
this[i].style['display']=this[i]['data-jqm-old-style']!=""?this[i]['data-jqm-old-style']:'block';
delete this[i]['data-jqm-old-style'];
}
}
return this;
},
Expand Down
7 changes: 4 additions & 3 deletions jq.mobi.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified kitchensink/images/list_arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified kitchensink/images/list_arrow_sel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94facc1

Please sign in to comment.