Permalink
Browse files

Panel: Close panel when clicking on a link in the panel with data-aja…

…x="false".
  • Loading branch information...
1 parent a5c3337 commit 41cffcb6da28c4c06b586cff998d313b2a0e71d1 @jaspermdegroot jaspermdegroot committed Jan 20, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 js/widgets/panel.js
View
@@ -151,11 +151,15 @@ $.widget( "mobile.panel", $.mobile.widget, {
_bindCloseEvents: function() {
var self = this;
+
self._closeLink.on( "click.panel" , function( e ) {
e.preventDefault();
self.close();
return false;
});
+ self.element.on( "click.panel" , "a:jqmData(ajax='false')", function( e ) {
+ self.close();
+ });
},
_positionPanel: function() {
@@ -203,7 +207,7 @@ $.widget( "mobile.panel", $.mobile.widget, {
_bindLinkListeners: function() {
var self = this;
- this._page.on( "click.panel" , "a", function( e ) {
+ self._page.on( "click.panel" , "a", function( e ) {
if ( this.href.split( "#" )[ 1 ] === self._panelID && self._panelID !== undefined ) {
e.preventDefault();
var $link = $( this );

0 comments on commit 41cffcb

Please sign in to comment.