From b61aacfd91d5d172c935bf4ab3f561a2c3959c4e Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Thu, 14 Sep 2006 05:59:13 +0000 Subject: [PATCH] Trunk/M092 topcrash @ nsMenuFrame::ActivateMenu, and a slew of dnd fixes (90151). r=dean sr=ben --- suite/browser/navigator.xul | 2 +- suite/browser/navigatorDD.js | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/suite/browser/navigator.xul b/suite/browser/navigator.xul index d33f5343434f..46d7b4f1a59b 100644 --- a/suite/browser/navigator.xul +++ b/suite/browser/navigator.xul @@ -262,7 +262,7 @@ Contributor(s): ______________________________________. --> type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type" label="rdf:http://home.netscape.com/NC-rdf#Name" ondraggesture="event.preventBubble(); return false;"> - + diff --git a/suite/browser/navigatorDD.js b/suite/browser/navigatorDD.js index ad980f4bdf7c..3825c8b9d2aa 100644 --- a/suite/browser/navigatorDD.js +++ b/suite/browser/navigatorDD.js @@ -79,7 +79,21 @@ var personalToolbarObserver = { // there. if (navigator.platform != "Win32" && aEvent.target.localName != "button") return; - + + + if (aEvent.target.localName == "menu" || aEvent.target.localName == "menubutton") { + if (aEvent.target.getAttribute("type") == "http://home.netscape.com/NC-rdf#Folder") { + var child = aEvent.target.childNodes[0]; + if (child && child.localName == "menupopup") + child.closePopup(); + else { + var parent = aEvent.target.parentNode; + if (parent && parent.localName == "menupopup") + parent.closePopup(); + } + } + } + var personalToolbar = document.getElementById("PersonalToolbar"); if (aEvent.target == personalToolbar) return; @@ -209,12 +223,7 @@ var personalToolbarObserver = { onDragOver: function (aEvent, aFlavour, aDragSession) { - var dropPosition - if (aEvent.target.getAttribute("type") == "http://home.netscape.com/NC-rdf#Folder" - && aEvent.target.getAttribute("container") == "true") - dropPosition = this.DROP_ON; - else - dropPosition = this.determineDropPosition(aEvent); + var dropPosition = this.determineDropPosition(aEvent); // bail if drop target is not a valid bookmark item or folder var inner = document.getElementById("innermostBox"); @@ -280,7 +289,7 @@ var personalToolbarObserver = { // you can drop ONTO containers, so there is a "middle" region if (overButton.getAttribute("container") == "true" && overButton.getAttribute("type") == "http://home.netscape.com/NC-rdf#Folder") - regionCount = 3; + return this.DROP_ON; var regionWidth = overButtonBoxObject.width/regionCount; @@ -316,6 +325,8 @@ var personalToolbarObserver = { case "menu": case "menuitem": var menu = aElement.parentNode.parentNode; + if (menu.getAttribute("type") != "http://home.netscape.com/NC-rdf#Folder") + return RDFUtils.getResource("NC:BookmarksRoot"); return RDFUtils.getResource(menu.id); case "treecell": var treeitem = aElement.parentNode.parentNode.parentNode.parentNode;