From: Alan Knowles Date: Mon, 17 Dec 2018 06:45:42 +0000 (+0800) Subject: Ticket.bjs X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=0fbf2ab18d22def5d95d27cd9fded1caebb91bf0 Ticket.bjs Ticket.vala --- diff --git a/Ticket.bjs b/Ticket.bjs index 9b4b6c3d..a745f6c7 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_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.priority_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.priority_id.selectedPriorityId() == \"\") {\n\t\t_this.priority_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}" + "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.priority_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.priority_id.selectedPriorityId() == \"\") {\n\t\t_this.priority_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.classification_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.classification_id.selectedClassificationId() == \"\") {\n\t\t_this.classification_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t\t_this.classification_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.classification_id.selectedClassificationId() == \"\") {\n\t\t_this.classification_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\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 2746b6d2..609cf72f 100644 --- a/Ticket.vala +++ b/Ticket.vala @@ -1184,6 +1184,17 @@ public class Ticket : Object invalid = true; } + _this.classification_id.el.get_style_context().remove_class("warning"); + if (_this.classification_id.selectedClassificationId() == "") { + _this.classification_id.el.get_style_context().add_class("warning"); + invalid = true; + } + + _this.classification_id.el.get_style_context().remove_class("warning"); + if (_this.classification_id.selectedClassificationId() == "") { + _this.classification_id.el.get_style_context().add_class("warning"); + invalid = true; + } if (invalid) { return;