From: Florian Zeitz Date: Thu, 2 Aug 2012 18:29:58 +0000 (+0200) Subject: Fix all buttons performing the "complete" action X-Git-Url: http://cgit.babelmonkeys.de/?p=adhocweb.git;a=commitdiff_plain;h=87bfedccdb91e2ff7cfb165e989e5259c155b513 Fix all buttons performing the "complete" action --- diff --git a/js/adhoc.js b/js/adhoc.js index a4e1574..cbe2752 100644 --- a/js/adhoc.js +++ b/js/adhoc.js @@ -169,9 +169,12 @@ Adhoc.prototype = { if (status === "executing") { var controls = $("
"); for (kind in kinds) { - var input = $("").click(function() { - self.executeCommand(kind, (kind != 'prev') && self.serializeToDataform('form'), function(e) { self.displayResult(e) }); - }).appendTo(controls); + var input; + (function (type) { + input = $("").click(function() { + self.executeCommand(type, (type != 'prev') && self.serializeToDataform('form'), function(e) { self.displayResult(e) }); + }).appendTo(controls); + })(kind); if (actions.find(kind).length > 0) input.removeAttr("disabled"); if (actions.attr("execute") == kind)