Permalink
Browse files

Fixed clickthrough wallpaper. removed some needless code

  • Loading branch information...
hiroprotagonist committed Dec 7, 2011
1 parent df9cfb6 commit 81cf3e4a2e6b56125a5a1a6821b013623ccec516
Showing with 18 additions and 18 deletions.
  1. +5 −5 jquery.mobile.actionsheet.css
  2. +13 −13 jquery.mobile.actionsheet.js
@@ -5,9 +5,9 @@
position: absolute;
top:0;
left: 0;
- min-height: 100%;
- height: auto;
+ height: 100%;
width: 100%;
+ z-index: 19; /* above content underneath sheet */
}
.ui-actionsheet-content {
-moz-border-radius: 8px;
@@ -21,9 +21,9 @@
position: absolute;
width: 230px;
z-index: 20;
- -moz-box-shadow: 0px 0px 12px rgba(0,0,0,.6);
- -webkit-box-shadow: 0px 0px 12px rgba(0,0,0,.6);
- box-shadow: 0px 0px 12px rgba(0,0,0,.6);
+ -moz-box-shadow: 0px 0px 12px rgba(0,0,0,.6);
+ -webkit-box-shadow: 0px 0px 12px rgba(0,0,0,.6);
+ box-shadow: 0px 0px 12px rgba(0,0,0,.6);
}
.ui-actionsheet-commandbtn {}
.ui-actionsheet-closebtn {
@@ -5,7 +5,7 @@
* Dual licensed under the MIT and GPL Version 2 licenses.
*
* Date: 2011-05-03 17:11:00 (Tue, 3 May 2011)
- * Revision: 1
+ * Revision: 1.1
*/
(function($,window){
$.widget("mobile.actionsheet",$.mobile.widget,{
@@ -27,31 +27,34 @@
//setup command buttons
this.content.find(':jqmData(role="button")').filter(':jqmData(rel!="close")')
.addClass('ui-actionsheet-commandbtn')
- .bind('tap', function(){
+ .bind('click', function(){
self.reset();
});
//setup close button
this.content.find(':jqmData(rel="close")')
.addClass('ui-actionsheet-closebtn')
- .bind('tap', function(){
+ .bind('click', function(){
self.close();
});
- this.element.bind('tap', function(){
+ this.element.bind('click', function(){
self.open();
});
if( this.element.parents( ':jqmData(role="content")' ).length !== 0 ) {
this.element.buttonMarkup();
}
},
open: function() {
- this.element.unbind('tap'); //avoid twice opening
+ this.element.unbind('click'); //avoid twice opening
var cc= this.content.parents(':jqmData(role="content")');
this.wallpaper= $('<div>', {'class':'ui-actionsheet-wallpaper'})
.appendTo(cc)
.show();
- window.setTimeout($.proxy(this._wbc, this), 500);
+ //window.setTimeout($.proxy(this._wbc, this), 500);
+ this.wallpaper.bind(
+ "click",
+ $.proxy(function() { this.close(); },this));
this._positionContent();
$(window).bind('orientationchange.actionsheet',$.proxy(function () {
@@ -67,9 +70,9 @@
this.content.fadeIn();
}
},
- close: function() {
+ close: function(event) {
var self = this;
- this.wallpaper.unbind('tap');
+ this.wallpaper.unbind('click');
$(window).unbind('orientationchange.actionsheet');
if( $.support.cssTransitions ) {
this.content.addClass("ui-actionsheet-animateOut");
@@ -80,7 +83,7 @@
} else {
this.wallpaper.remove();
this.content.fadeOut();
- this.element.bind('tap', function(){
+ this.element.bind('click', function(){
self.open();
});
}
@@ -92,7 +95,7 @@
.removeClass("ui-actionsheet-animateIn")
.hide();
var self= this;
- this.element.bind('tap', function(){
+ this.element.bind('click', function(){
self.open();
});
},
@@ -104,9 +107,6 @@
'top': (scrollPosition + height / 2 - this.content.height() / 2),
'left': (width / 2 - this.content.width() / 2)
});
- },
- _wbc: function() {
- this.wallpaper.bind("tap", $.proxy(this.close, this));
}
});

0 comments on commit 81cf3e4

Please sign in to comment.