From c62e14f1cc1a092996076e96b1074f36ba5a3425 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 5 Sep 2015 18:24:46 -0400 Subject: Replace color dropdown by color picker in task forms --- assets/js/src/App.js | 2 ++ assets/js/src/Task.js | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 assets/js/src/Task.js (limited to 'assets/js/src') diff --git a/assets/js/src/App.js b/assets/js/src/App.js index 2872baf6..02aa7693 100644 --- a/assets/js/src/App.js +++ b/assets/js/src/App.js @@ -7,6 +7,7 @@ function App() { this.dropdown = new Dropdown(); this.tooltip = new Tooltip(this); this.popover = new Popover(this); + this.task = new Task(); this.keyboardShortcuts(); this.chosen(); this.poll(); @@ -34,6 +35,7 @@ App.prototype.listen = function() { this.tooltip.listen(); this.dropdown.listen(); this.search.listen(); + this.task.listen(); this.search.focus(); this.taskAutoComplete(); this.datePicker(); diff --git a/assets/js/src/Task.js b/assets/js/src/Task.js new file mode 100644 index 00000000..b3dc1b63 --- /dev/null +++ b/assets/js/src/Task.js @@ -0,0 +1,10 @@ +function Task() { +} + +Task.prototype.listen = function() { + $(document).on("click", ".color-square", function() { + $(".color-square-selected").removeClass("color-square-selected"); + $(this).addClass("color-square-selected"); + $("#form-color_id").val($(this).data("color-id")); + }); +}; -- cgit v1.2.3