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 ddeb291801a49b90062510d4e05f8531216cdff9 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 19 Jun 2012 11:30:15 -0700 Subject: IKNINJA 1754 menu not opening on hover Signed-off-by: Valerio Virgillito --- js/components/menu/menu-entry.reel/menu-entry.js | 26 ++++++------------------ js/components/menu/menu-item.reel/menu-item.js | 9 +++----- js/components/menu/menu.reel/menu.html | 3 ++- 3 files changed, 11 insertions(+), 27 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..4fea0fe9 100755 --- a/js/components/menu/menu-entry.reel/menu-entry.js +++ b/js/components/menu/menu-entry.reel/menu-entry.js @@ -9,18 +9,15 @@ var Component = require("montage/ui/component").Component; exports.MenuEntry = Montage.create(Component, { topHeader: { - value: null, - serializable: true + value: null }, topHeaderText: { - value: null, - serializable: true + value: null }, subEntries: { - value: null, - serializable: true + value: null }, // Reference to the parent Menu component @@ -36,8 +33,7 @@ exports.MenuEntry = Montage.create(Component, { if(value !== this._menu) { this._menu = value; } - }, - serializable: true + } }, _data: { @@ -52,8 +48,7 @@ exports.MenuEntry = Montage.create(Component, { if(this._data !== value) { this._data = value; } - }, - serializable: true + } }, select: { @@ -79,7 +74,7 @@ exports.MenuEntry = Montage.create(Component, { return this._menuIsActive; }, set: function(value) { - if(value) this.topHeader.addEventListener("mouseover", this, false); + if(value) this.element.addEventListener("mouseover", this, false); } }, @@ -87,14 +82,12 @@ exports.MenuEntry = Montage.create(Component, { value: function(event) { // TODO: Hack! Rework this! this.parentComponent.ownerComponent.toggleActivation(this); -// this._menu.toggleActivation(this); } }, handleMouseover: { value: function(event) { this.parentComponent.ownerComponent.activeEntry = this; -// this._menu.activeEntry = this; } }, @@ -106,13 +99,6 @@ exports.MenuEntry = Montage.create(Component, { this.topHeaderText.innerHTML = this.data.header; this.element.addEventListener("click", this, false); - - Object.defineBinding(this, "menuIsActive", { - boundObject: this._menu, - boundObjectPropertyPath: "active", - oneway: true - }); - } } }); \ No newline at end of file diff --git a/js/components/menu/menu-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js index f9a625a3..3a5bf4ab 100755 --- a/js/components/menu/menu-item.reel/menu-item.js +++ b/js/components/menu/menu-item.reel/menu-item.js @@ -10,18 +10,15 @@ var Component = require("montage/ui/component").Component; exports.MenuItem = Montage.create(Component, { itemBackground: { - value: null, - serializable: true + value: null }, itemText: { - value: null, - serializable: true + value: null }, subMenu: { - value: null, - serializable: true + value: null }, data: { diff --git a/js/components/menu/menu.reel/menu.html b/js/components/menu/menu.reel/menu.html index f18c1a0f..98ffa92c 100755 --- a/js/components/menu/menu.reel/menu.html +++ b/js/components/menu/menu.reel/menu.html @@ -44,7 +44,8 @@ "element": { "#": "menuItem" } }, "bindings": { - "data": {"<-": "@repetition.objectAtCurrentIteration"} + "data": {"<-": "@repetition.objectAtCurrentIteration"}, + "menuIsActive": {"<-": "@owner.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