Rewrite dropdown menu

This commit is contained in:
Frederic Guillot
2015-08-07 22:42:29 -04:00
parent 2d5621af2f
commit 679cb94de4
14 changed files with 172 additions and 377 deletions

View File

@@ -1,10 +1,11 @@
function App() {
this.popover = new Popover(this);
this.markdown = new Markdown();
this.sidebar = new Sidebar();
this.search = new Search();
this.tooltip = new Tooltip(this);
this.swimlane = new Swimlane();
this.dropdown = new Dropdown();
this.tooltip = new Tooltip(this);
this.popover = new Popover(this);
this.keyboardShortcuts();
this.boardSelector();
this.listen();
@@ -33,15 +34,12 @@ App.prototype.listen = function() {
this.markdown.listen();
this.sidebar.listen();
this.tooltip.listen();
this.dropdown.listen();
this.search.listen();
this.search.focus();
this.taskAutoComplete();
this.datePicker();
this.focus();
// Dropdown
$(".dropit-submenu").hide();
$('.dropdown').not(".dropit").dropit({ triggerParentEl : "span" });
};
App.prototype.focus = function() {
@@ -67,6 +65,8 @@ App.prototype.poll = function() {
};
App.prototype.keyboardShortcuts = function() {
var self = this;
// Submit form
Mousetrap.bindGlobal("mod+enter", function() {
$("form").submit();
@@ -77,6 +77,12 @@ App.prototype.keyboardShortcuts = function() {
e.preventDefault();
$('#board-selector').trigger('chosen:open');
});
// Close popover and dropdown
Mousetrap.bindGlobal("esc", function() {
self.popover.close();
self.dropdown.close();
});
};
App.prototype.checkSession = function() {