X-Git-Url: http://cgit.babelmonkeys.de/?p=adhocweb.git;a=blobdiff_plain;f=js%2Fadhoc.js;h=cbe27523ab1ab905719fa82ca2fdce232d15c503;hp=3638eef87a99fc4c0c86040c228b340a26a690b0;hb=87bfedccdb91e2ff7cfb165e989e5259c155b513;hpb=a4c0f5025877f4858576dba28bbb461f0581a5d1 diff --git a/js/adhoc.js b/js/adhoc.js index 3638eef..cbe2752 100644 --- a/js/adhoc.js +++ b/js/adhoc.js @@ -156,6 +156,7 @@ Adhoc.prototype = { var self = this; var status = $(result).find("command").attr("status"); var kinds = {'prev': 'Prev', 'next': 'Next', 'complete': 'Complete'}; + var actions = $(result).find("actions:first"); $(self.status.view).empty(); $(result).find("command > *").each(function() { @@ -169,19 +170,17 @@ Adhoc.prototype = { var controls = $("
"); for (kind in kinds) { var input; - (function(type) { - input = $("").click(function() { - self.executeCommand(type, (type!= 'prev') && self.serializeToDataform('form'), function(e) { self.displayResult(e) }); - }).appendTo(controls); - })(kind); - if ($(result).find('actions ' + kind).length > 0) + (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) + input.addClass("primary"); } - $("").click(function() { - self.executeCommand("execute", self.serializeToDataform('form'), function(e) { self.displayResult(e) }); - }).appendTo(controls); - $("").click(function() { self.cancelCommand(function(e) { self.displayResult(e) }); }).appendTo(controls);