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/components') 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 From 0f59f00621c371ccee6793c57e17314d0a5a8fbe Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 19 Jun 2012 10:55:36 -0700 Subject: Fix for IKNINJA-1754 (CLONE) - Menu Component: Hovering over another main menu does not work when a main menu drop down is already displayed. Signed-off-by: Ananya Sen --- js/components/menu/menu-entry.reel/menu-entry.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/components') diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js index ae3469c6..b765471b 100755 --- a/js/components/menu/menu-entry.reel/menu-entry.js +++ b/js/components/menu/menu-entry.reel/menu-entry.js @@ -107,6 +107,9 @@ exports.MenuEntry = Montage.create(Component, { this.element.addEventListener("mousedown", this, true); + this.topHeader.addEventListener("mouseover", this, false);//Todo: check why this listener as not getting added menuIsActive + + //Todo: check this binding Object.defineBinding(this, "menuIsActive", { boundObject: this._menu, boundObjectPropertyPath: "active", -- cgit v1.2.3 From fb553a8054162b2aa0848d86b11d4e27002bffa9 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 19 Jun 2012 13:50:10 -0700 Subject: Reverting last change since this is is being made in a different pull request. Signed-off-by: Ananya Sen --- js/components/menu/menu-entry.reel/menu-entry.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'js/components') diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js index b765471b..ae3469c6 100755 --- a/js/components/menu/menu-entry.reel/menu-entry.js +++ b/js/components/menu/menu-entry.reel/menu-entry.js @@ -107,9 +107,6 @@ exports.MenuEntry = Montage.create(Component, { this.element.addEventListener("mousedown", this, true); - this.topHeader.addEventListener("mouseover", this, false);//Todo: check why this listener as not getting added menuIsActive - - //Todo: check this binding Object.defineBinding(this, "menuIsActive", { boundObject: this._menu, boundObjectPropertyPath: "active", -- cgit v1.2.3