From 486f335d7e25f0b1269be47836b481f1e6db4102 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 17 Dec 2018 14:44:47 +0800 Subject: [PATCH] Ticket.bjs Ticket.vala --- Ticket.bjs | 2 +- Ticket.vala | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Ticket.bjs b/Ticket.bjs index 2a41ff97..8ad17301 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\t_this.project_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.project_id.selectedProjectId() == \"\") {\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}" + "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.selectedProjectId() == \"\") {\n\t\t_this.project_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.milestone_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.milestone_id.selectedMilestoneId() == \"\") {\n\t\t_this.milestone_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\n\t_this.milestone_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.milestone_id.selectedProjectId() == \"\") {\n\t\t_this.milestone_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\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 85624e27..5354ea20 100644 --- a/Ticket.vala +++ b/Ticket.vala @@ -1172,6 +1172,17 @@ public class Ticket : Object invalid = true; } + _this.milestone_id.el.get_style_context().remove_class("warning"); + if (_this.milestone_id.selectedMilestoneId() == "") { + _this.milestone_id.el.get_style_context().add_class("warning"); + invalid = true; + } + + _this.milestone_id.el.get_style_context().remove_class("warning"); + if (_this.milestone_id.selectedProjectId() == "") { + _this.milestone_id.el.get_style_context().add_class("warning"); + invalid = true; + } if (invalid) { -- 2.39.2