From f47dace72a81cddfa29d89540629cfdd76d54b18 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 18 Jun 2012 11:36:20 -0700 Subject: Fixed - IKNINJA-1313 - File menu drop down should close when New File dialog is opened Signed-off-by: Ananya Sen --- js/components/menu/menu-entry.reel/menu-entry.js | 4 ++-- js/components/menu/menu.reel/menu.js | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'js') diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js index b9c546ed..ae3469c6 100755 --- a/js/components/menu/menu-entry.reel/menu-entry.js +++ b/js/components/menu/menu-entry.reel/menu-entry.js @@ -83,7 +83,7 @@ exports.MenuEntry = Montage.create(Component, { } }, - handleClick: { + captureMousedown: { value: function(event) { // TODO: Hack! Rework this! this.parentComponent.ownerComponent.toggleActivation(this); @@ -105,7 +105,7 @@ exports.MenuEntry = Montage.create(Component, { this.topHeaderText.innerHTML = this.data.header; - this.element.addEventListener("click", this, false); + this.element.addEventListener("mousedown", this, true); Object.defineBinding(this, "menuIsActive", { boundObject: this._menu, diff --git a/js/components/menu/menu.reel/menu.js b/js/components/menu/menu.reel/menu.js index 50d3f0bc..1560100a 100755 --- a/js/components/menu/menu.reel/menu.js +++ b/js/components/menu/menu.reel/menu.js @@ -83,19 +83,12 @@ exports.Menu = Montage.create(Component, { handleMousedown: { value: function(evt) { - if(this.active && (this.getZIndex(evt.target) < 9000 || evt.target.id === "topMenu")) { this._activeEntry.deselect(); this._activeEntry = null; this.active = false; - - //console.log(this.rep.objects[1]); - //this.controller.content[1].header = "BLAH"; + this.element.ownerDocument.removeEventListener('mousedown', this, false); } - -// console.log(evt.target.style['z-index']); -// console.log(this.getZIndex(evt.target)); - } }, -- cgit v1.2.3