Fix Prev button
authorFlorian Zeitz <florob@babelmonkeys.de>
Tue, 20 Dec 2011 21:26:13 +0000 (22:26 +0100)
committerFlorian Zeitz <florob@babelmonkeys.de>
Tue, 20 Dec 2011 21:26:13 +0000 (22:26 +0100)
js/adhoc.js

index 3f2ae2b4e96843896f95fdc1a4dc8c540be2e529..7e2ba521bc30e910dcc9a258bc973493d2e6855b 100644 (file)
@@ -162,9 +162,11 @@ var Adhoc = {
         });
         if (status === "executing") {
             for (kind in kinds) {
-                input = $("<input type='button' disabled='disabled' value='" + kinds[kind] + "'/>").click(function() {
-                    self.executeCommand(kind, (kind != 'prev') && self.serializeToDataform('form'), function(e) { self.displayResult(elem, e) });
-                });
+                (function(type) {
+                    input = $("<input type='button' disabled='disabled' value='" + kinds[type] + "'/>").click(function() {
+                        self.executeCommand(type, (type!= 'prev') && self.serializeToDataform('form'), function(e) { self.displayResult(elem, e) });
+                    });
+                })(kind);
                 if ($(result).find('actions ' + kind).length > 0)
                     input.removeAttr("disabled");
                 $(elem).append(input);