Skip to content

Commit

Permalink
lock element after clicking (this prevents accidental doubleclicks)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Cichra committed Mar 20, 2012
1 parent 4709299 commit 6a897e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions guiders-1.2.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var guiders = (function($) {
thisButtonElem.bind("click", function() { guiders.hideAll(); });
} else if (!thisButton.onclick &&
thisButton.name.toLowerCase() === guiders._nextButtonTitle.toLowerCase()) {
thisButtonElem.bind("click", function() { guiders.next(); });
thisButtonElem.bind("click", function() { !myGuider.elem.data('locked') && guiders.next(); });
}
}

Expand Down Expand Up @@ -280,6 +280,8 @@ var guiders = (function($) {
if (typeof currentGuider === "undefined") {
return;
}
currentGuider.elem.data('locked', true);

var nextGuiderId = currentGuider.next || null;
if (nextGuiderId !== null && nextGuiderId !== "") {
var myGuider = guiders._guiderById(nextGuiderId);
Expand Down Expand Up @@ -389,7 +391,7 @@ var guiders = (function($) {

guiders._attach(myGuider);

myGuider.elem.fadeIn("fast");
myGuider.elem.fadeIn("fast").data('locked', false);

var windowHeight = $(window).height();
var scrollHeight = $(window).scrollTop();
Expand Down

0 comments on commit 6a897e6

Please sign in to comment.