Skip to content

Commit

Permalink
#5 ready for jqm 1beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Gebhardt committed Jun 27, 2011
1 parent ef13751 commit 2e9ea5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
<html>
<head>
<title>Test 1 2 3</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<link rel="stylesheet" href="jquery.mobile.actionsheet.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
<script type="text/javascript" src="jquery.mobile.actionsheet.js"></script>
</head>
<body>
Expand Down
16 changes: 8 additions & 8 deletions jquery.mobile.actionsheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,32 @@
//setup command buttons
this.content.find(':jqmData(role="button")').filter(':jqmData(rel!="close")')
.addClass('ui-actionsheet-commandbtn')
.bind('click', function(){
.bind('vclick', function(){
self.reset();
});
//setup close button
this.content.find(':jqmData(rel="close")')
.addClass('ui-actionsheet-closebtn')
.bind('click', function(){
.bind('vclick', function(){
self.close();
});
this.element.bind('click', function(){
this.element.bind('vclick', function(){
self.open();
});
if( this.element.parents( ':jqmData(role="content")' ).length !== 0 ) {
this.element.buttonMarkup();
}
},
open: function() {
this.element.unbind('click'); //avoid twice opening
this.element.unbind('vclick'); //avoid twice opening

var cc= this.content.parents(':jqmData(role="content")');
this.wallpaper= $('<div>', {'class':'ui-actionsheet-wallpaper'})
.appendTo(cc)
.show();

window.setTimeout(function(self) {
self.wallpaper.bind('click', function() {
self.wallpaper.bind('vclick', function() {
self.close();
});
}, 500, this);
Expand All @@ -70,7 +70,7 @@
},
close: function() {
var self = this;
this.wallpaper.unbind('click');
this.wallpaper.unbind('vclick');
$(window).unbind('orientationchange.actionsheet');
if( $.support.cssTransitions ) {
this.content.addClass("ui-actionsheet-animateOut");
Expand All @@ -81,7 +81,7 @@
} else {
this.wallpaper.remove();
this.content.fadeOut();
this.element.bind('click', function(){
this.element.bind('vclick', function(){
self.open();
});
}
Expand All @@ -93,7 +93,7 @@
.removeClass("ui-actionsheet-animateIn")
.hide();
var self= this;
this.element.bind('click', function(){
this.element.bind('vclick', function(){
self.open();
});
},
Expand Down

0 comments on commit 2e9ea5e

Please sign in to comment.