From a7bf8a78d6bfe7eaaaf5dad3fa17a798bfb79594 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 17 Dec 2018 14:44:03 +0800 Subject: [PATCH] Ticket.bjs Ticket.vala --- Ticket.bjs | 2 +- Ticket.vala | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Ticket.bjs b/Ticket.bjs index 283f8990..26406e6a 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 = 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}" + "clicked" : "() => {\n\tGLib.debug(\"fire response = 1\");\n\t\n\t\n\tvar invalid = false;\n\t\n\t// validate first...\n\t_this.project_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.project_id.getProjectId() == \"\") {\n\t\t_this.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 bc6818d5..4c28919d 100644 --- a/Ticket.vala +++ b/Ticket.vala @@ -1166,9 +1166,9 @@ public class Ticket : Object var invalid = false; // validate first... - this.project_id.el.get_style_context().remove_class("warning"); - this.project_id.getProjectId() == "") { - this.project_id.el.get_style_context().add_class("warning"); + _this.project_id.el.get_style_context().remove_class("warning"); + if (_this.project_id.getProjectId() == "") { + _this.project_id.el.get_style_context().add_class("warning"); invalid = true; } -- 2.39.2