Permalink
Browse files

Preventing default with click listener

  • Loading branch information...
1 parent f1ce008 commit d0ed5a261c7b09695d4414e72aa7c24ff6061914 Nathan Long committed Feb 3, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 jquery.persistentpanel.js
@@ -1,5 +1,5 @@
// ---------------------------------------------
-// persistentPanel v1.1
+// persistentPanel v1.11
// A jQuery plugin by Nathan Long
// https://github.com/sleeplessgeek/persistentPanel
// ---------------------------------------------
@@ -128,7 +128,7 @@
initialize();
// Add namespaced click event listener
- $(settings.toggler).bind('click.persistentPanel',function(){
+ $(settings.toggler).bind('click.persistentPanel',function(e){
switch($.data(panel, 'persistentPanelState')) {
case 'open':
close();
@@ -137,6 +137,8 @@
open();
break;
}
+ // Don't follow that link
+ e.preventDefault();
});
// Maintain chainability

0 comments on commit d0ed5a2

Please sign in to comment.