diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-03-19 17:44:43 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-03-19 17:44:43 -0400 |
commit | 6bd0ce25c9546ceb68615a3321e0afc11ae29e6b (patch) | |
tree | fcbbbf8e335781794afec6c0bad9e0419189031c /assets/js/core/base.js | |
parent | b27a7db35465817afd54aa2af99446e9a13ffd76 (diff) |
Restore task title link on board
Diffstat (limited to 'assets/js/core/base.js')
-rw-r--r-- | assets/js/core/base.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/assets/js/core/base.js b/assets/js/core/base.js index 6bfe22ba..165e74ac 100644 --- a/assets/js/core/base.js +++ b/assets/js/core/base.js @@ -37,8 +37,11 @@ KB.removeListener = function (eventType, callback) { } }; -KB.onClick = function (selector, callback) { - this.listeners.clicks[selector] = callback; +KB.onClick = function (selector, callback, noPreventDefault) { + this.listeners.clicks[selector] = { + callback: callback, + noPreventDefault: noPreventDefault === true + }; }; KB.onChange = function (selector, callback) { @@ -62,8 +65,11 @@ KB.listen = function () { function onClick(e) { for (var selector in self.listeners.clicks) { if (self.listeners.clicks.hasOwnProperty(selector) && e.target.matches(selector)) { - e.preventDefault(); - self.listeners.clicks[selector](e); + if (! self.listeners.clicks[selector].noPreventDefault) { + e.preventDefault(); + } + + self.listeners.clicks[selector].callback(e); } } } |