From: Alan Knowles Date: Mon, 17 Dec 2018 06:43:35 +0000 (+0800) Subject: Ticket.bjs X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=7b57259ff3fe00f21f8e5483510cfdfc41e0f572 Ticket.bjs Ticket.vala --- diff --git a/Ticket.bjs b/Ticket.bjs index c2b7c413..283f8990 100644 --- a/Ticket.bjs +++ b/Ticket.bjs @@ -259,7 +259,7 @@ }, { "listeners" : { - "clicked" : "() => {\n\tGLib.debug(\"fire response = 1\");\n\t\n\t\n\tvar invalid = true;\n\t\n\t// validate first...\n\tthis.el.get_style_context().add_class(\"suggested-action\");\n\t\n\t\n\t\n\t\n\t\n\t_this.el.response(1);\n}" + "clicked" : "() => {\n\tGLib.debug(\"fire response = 1\");\n\t\n\t\n\tvar invalid = false;\n\t\n\t// validate first...\n\tthis.project_id.el.get_style_context().remove_class(\"warning\");\t\n\tthis.project_id.getProjectId() == \"\") {\n\t\tthis.project_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t\n\t\n\tif (invalid) {\n\t\treturn;\n\t}\n\t\n\t_this.el.response(1);\n}" }, "label" : "Create Ticket", "* init" : "{\n this.el.get_style_context().add_class(\"suggested-action\");\n}\n", diff --git a/Ticket.vala b/Ticket.vala index a3f337f4..bc6818d5 100644 --- a/Ticket.vala +++ b/Ticket.vala @@ -1163,14 +1163,20 @@ public class Ticket : Object GLib.debug("fire response = 1"); - var invalid = true; + var invalid = false; // validate first... - this.el.get_style_context().add_class("suggested-action"); - + this.project_id.el.get_style_context().remove_class("warning"); + this.project_id.getProjectId() == "") { + this.project_id.el.get_style_context().add_class("warning"); + invalid = true; + } + if (invalid) { + return; + } _this.el.response(1); });