diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-05 18:24:46 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-05 18:24:46 -0400 |
commit | c62e14f1cc1a092996076e96b1074f36ba5a3425 (patch) | |
tree | d04f8fbf2e89f614ec78a5b644b30ed872af46dc /assets/js/src | |
parent | 70d3340cd0c9d7a009c186b14ca436e9c4e61aa5 (diff) |
Replace color dropdown by color picker in task forms
Diffstat (limited to 'assets/js/src')
-rw-r--r-- | assets/js/src/App.js | 2 | ||||
-rw-r--r-- | assets/js/src/Task.js | 10 |
2 files changed, 12 insertions, 0 deletions
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")); + }); +}; |