From: Alan Knowles Date: Wed, 13 Feb 2019 06:27:04 +0000 (+0800) Subject: NewBranch.bjs X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=81f4c5417a5ba2eb73ed3bd9df0ffe6ff8afcd41 NewBranch.bjs NewBranch.vala --- diff --git a/NewBranch.bjs b/NewBranch.bjs index d70e8dd0..a2476995 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -154,7 +154,7 @@ }, "label" : "Create Branch", "id" : "createbtn", - "| void updateState" : "() {\n\n\nif (_this.actionsel.selectedAction() == \"\") {\n\t\t// need to select an action..\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t\n\t\n\t}\n\t\tthis.el.set_sensitive(true);\n\t\treturn;\n}\n", + "| void updateState" : "() {\n\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n\tif (ticket_id == \"\") {\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t}\n \n\tthis.el.set_sensitive(true);\n \n}\n", "* init" : "{\n this.el.get_style_context().add_class(\"suggested-action\");\n}\n", "xtype" : "Button", "* pack" : "attach_defaults,4,5,4,5", diff --git a/NewBranch.vala b/NewBranch.vala index 16ba8cae..03912491 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -738,16 +738,15 @@ public class NewBranch : Object // user defined functions public void updateState () { - - if (_this.actionsel.selectedAction() == "") { - // need to select an action.. + var ticket_id = _this.ticketsel.selectedTicketId(); + + if (ticket_id == "") { this.el.set_sensitive(false); return; - - } - this.el.set_sensitive(true); - return; + + this.el.set_sensitive(true); + } }