summaryrefslogtreecommitdiff
path: root/assets/js/src/Dropdown.js
diff options
context:
space:
mode:
authorON-jz <on.jz.github@gmail.com>2017-05-17 15:45:12 +0200
committerFrédéric Guillot <fred@kanboard.net>2017-05-18 21:47:44 -0400
commite8c83c97d7f1fa9028fac9dc44f94959349ca074 (patch)
tree8f262c8cac73ec34b9f9e20076d23d819cb85412 /assets/js/src/Dropdown.js
parent3477cd8c5ac2c103c727628f18a0eeb082a93766 (diff)
Added new javascript events for dropdown and modal
- dropdown.clicked - dropdown.afterRender - dropdown.beforeDestroy - modal.open - modal.afterRender - modal.beforeDestroy
Diffstat (limited to 'assets/js/src/Dropdown.js')
-rw-r--r--assets/js/src/Dropdown.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/assets/js/src/Dropdown.js b/assets/js/src/Dropdown.js
index ec033b3e..406d0460 100644
--- a/assets/js/src/Dropdown.js
+++ b/assets/js/src/Dropdown.js
@@ -41,15 +41,26 @@ Kanboard.Dropdown.prototype.listen = function() {
else {
clone.css('left', offset.left);
}
+
+ if (document.getElementById('dropdown') !== null) {
+ KB.trigger('dropdown.afterRender');
+ }
});
$(document).on('click', '.dropdown-submenu-open li', function(e) {
+
if ($(e.target).is('li')) {
+ KB.trigger('dropdown.clicked');
+
$(this).find('a:visible')[0].click(); // Calling native click() not the jQuery one
}
});
};
Kanboard.Dropdown.prototype.close = function() {
+ if (document.getElementById('dropdown') !== null) {
+ KB.trigger('dropdown.beforeDestroy');
+ }
+
$("#dropdown").remove();
};