From d7123dd2f0ec035648ecf7bdec0cb66bdea72e04 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 15 Jun 2012 15:20:27 -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-item.reel/menu-item.js | 1 - js/components/menu/menu.reel/menu.js | 9 +-------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js index 57e6ec87..1cea19b3 100755 --- a/js/components/menu/menu-entry.reel/menu-entry.js +++ b/js/components/menu/menu-entry.reel/menu-entry.js @@ -47,7 +47,7 @@ exports.MenuEntry = Montage.create(Component, { } }, - handleClick: { + captureMousedown: { value: function(event) { this._menu.toggleActivation(this); } @@ -66,7 +66,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-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js index c00c4412..9d204b72 100755 --- a/js/components/menu/menu-item.reel/menu-item.js +++ b/js/components/menu/menu-item.reel/menu-item.js @@ -122,7 +122,6 @@ exports.MenuItem = Montage.create(Component, { captureMousedown: { value: function(event) { - if(this.data.radio && this.checked) return; if( ( this.enabled === true || this.enabled > 0 ) && (this.submenu === false) ) { 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