Bug 62423. Alt+down now opens history list in URL bar. r=ben, sr=hewitt

This commit is contained in:
aaronl%netscape.com 2001-12-17 07:44:57 +00:00
Родитель 12cb96f2dd
Коммит ab93285bed
5 изменённых файлов: 29 добавлений и 25 удалений

Просмотреть файл

@ -106,11 +106,11 @@ var personalToolbarObserver = {
if (aEvent.target.getAttribute("type") == "http://home.netscape.com/NC-rdf#Folder") { if (aEvent.target.getAttribute("type") == "http://home.netscape.com/NC-rdf#Folder") {
var child = aEvent.target.childNodes[0]; var child = aEvent.target.childNodes[0];
if (child && child.localName == "menupopup") if (child && child.localName == "menupopup")
child.closePopup(); child.hidePopup();
else { else {
var parent = aEvent.target.parentNode; var parent = aEvent.target.parentNode;
if (parent && parent.localName == "menupopup") if (parent && parent.localName == "menupopup")
parent.closePopup(); parent.hidePopup();
} }
} }
} }
@ -438,7 +438,7 @@ var bookmarksButtonObserver = {
{ {
aEvent.target.setAttribute("dragover", "true"); aEvent.target.setAttribute("dragover", "true");
if (!gDidOpen) { if (!gDidOpen) {
aEvent.target.firstChild.openPopup(document.getElementById("bookmarks-button"), -1, -1, "menupopup", "bottomleft", "bottomleft"); aEvent.target.firstChild.showPopup(document.getElementById("bookmarks-button"), -1, -1, "menupopup", "bottomleft", "bottomleft");
gDidOpen = true; gDidOpen = true;
} }
return true; return true;
@ -459,7 +459,7 @@ function closeOpenMenu()
if (gCurrentDragOverMenu && gCurrentTarget.firstChild != gCurrentDragOverMenu) { if (gCurrentDragOverMenu && gCurrentTarget.firstChild != gCurrentDragOverMenu) {
if (gCurrentTarget.parentNode != gCurrentDragOverMenu) { if (gCurrentTarget.parentNode != gCurrentDragOverMenu) {
gMenuIsOpen = false; gMenuIsOpen = false;
gCurrentDragOverMenu.closePopup(); gCurrentDragOverMenu.hidePopup();
gCurrentDragOverMenu = null; gCurrentDragOverMenu = null;
} }
} }
@ -475,13 +475,13 @@ var menuDNDObserver = {
if (aEvent.target.firstChild && aEvent.target.firstChild.localName == "menupopup") { if (aEvent.target.firstChild && aEvent.target.firstChild.localName == "menupopup") {
if (aEvent.target.parentNode == document.getElementById("bookmarks-button").firstChild) { if (aEvent.target.parentNode == document.getElementById("bookmarks-button").firstChild) {
if (gCurrentDragOverMenu && gCurrentDragOverMenu != aEvent.target.firstChild) { if (gCurrentDragOverMenu && gCurrentDragOverMenu != aEvent.target.firstChild) {
gCurrentDragOverMenu.closePopup(); gCurrentDragOverMenu.hidePopup();
gCurrentDragOverMenu = null; gCurrentDragOverMenu = null;
gMenuIsOpen = false; gMenuIsOpen = false;
} }
if (!gMenuIsOpen) { if (!gMenuIsOpen) {
gCurrentDragOverMenu = aEvent.target.firstChild; gCurrentDragOverMenu = aEvent.target.firstChild;
aEvent.target.firstChild.openPopup(aEvent.target, -1, -1, "menupopup", "topright, topright"); aEvent.target.firstChild.showPopup(aEvent.target, -1, -1, "menupopup", "topright, topright");
gMenuIsOpen = true; gMenuIsOpen = true;
} }
} }
@ -596,7 +596,7 @@ var menuDNDObserver = {
// if user isn't rearranging within the menu, close it // if user isn't rearranging within the menu, close it
if (aDragSession.sourceNode.localName != "menuitem" && aDragSession.sourceNode.localName != "menu") if (aDragSession.sourceNode.localName != "menuitem" && aDragSession.sourceNode.localName != "menu")
setTimeout(function() { if (gCurrentDragOverMenu) gCurrentDragOverMenu.closePopup(); document.getElementById("bookmarks-button").firstChild.closePopup(); gDidOpen = false; }, 190); setTimeout(function() { if (gCurrentDragOverMenu) gCurrentDragOverMenu.hidePopup(); document.getElementById("bookmarks-button").firstChild.hidePopup(); gDidOpen = false; }, 190);
return true; return true;
}, },

Просмотреть файл

@ -861,10 +861,16 @@
this.closeResultPopup(); this.closeResultPopup();
break; break;
case KeyEvent.DOM_VK_DOWN:
if (aEvent.altKey && !aEvent.ctrlKey && !aEvent.shiftKey && !this.hideHistory) {
var historyPopup = this.getElementsByTagName("menupopup").item(0);
if (historyPopup)
historyPopup.showPopup();
break;
}
case KeyEvent.DOM_VK_PAGE_UP: case KeyEvent.DOM_VK_PAGE_UP:
case KeyEvent.DOM_VK_PAGE_DOWN: case KeyEvent.DOM_VK_PAGE_DOWN:
case KeyEvent.DOM_VK_UP: case KeyEvent.DOM_VK_UP:
case KeyEvent.DOM_VK_DOWN:
this.clearTimer(); this.clearTimer();
killEvent = true; killEvent = true;
this.keyNavigation(aEvent); this.keyNavigation(aEvent);
@ -989,7 +995,7 @@
this.resultsPopup.setAttribute("width", w); this.resultsPopup.setAttribute("width", w);
} }
this.resultsPopup.openPopup(this, -1, -1, "popup", "bottomleft", "topleft"); this.resultsPopup.showPopup(this, -1, -1, "popup", "bottomleft", "topleft");
this.mMenuOpen = true; this.mMenuOpen = true;
} }
]]></body> ]]></body>
@ -999,7 +1005,7 @@
<method name="closeResultPopup"> <method name="closeResultPopup">
<body><![CDATA[ <body><![CDATA[
if (this.resultsPopup && this.mMenuOpen) { if (this.resultsPopup && this.mMenuOpen) {
this.resultsPopup.closePopup(); this.resultsPopup.hidePopup();
this.mMenuOpen = false; this.mMenuOpen = false;
} }
]]></body> ]]></body>

Просмотреть файл

@ -485,15 +485,15 @@
]]></body> ]]></body>
</method> </method>
<method name="openPopup"> <method name="showPopup">
<body><![CDATA[ <body><![CDATA[
this.mPicker.parentNode.openPopup(this, -1, -1, "popup", "bottomleft", "topleft"); this.mPicker.parentNode.showPopup(this, -1, -1, "popup", "bottomleft", "topleft");
]]></body> ]]></body>
</method> </method>
<method name="closePopup"> <method name="hidePopup">
<body><![CDATA[ <body><![CDATA[
this.mPicker.parentNode.closePopup(); this.mPicker.parentNode.hidePopup();
]]></body> ]]></body>
</method> </method>
@ -524,7 +524,7 @@
<method name="pickerChange"> <method name="pickerChange">
<body><![CDATA[ <body><![CDATA[
this.color = this.mPicker.color; this.color = this.mPicker.color;
setTimeout(function(aPopup) { aPopup.closePopup() }, 1, this.mPicker.parentNode); setTimeout(function(aPopup) { aPopup.hidePopup() }, 1, this.mPicker.parentNode);
if (this.onchange) if (this.onchange)
this.onchange(); this.onchange();
@ -542,7 +542,7 @@
// open popup if key is space/up/left/right/down and popup is closed // open popup if key is space/up/left/right/down and popup is closed
if ( (event.keyCode == 32 || (event.keyCode > 36 && event.keyCode < 41)) && !this.mOpen) if ( (event.keyCode == 32 || (event.keyCode > 36 && event.keyCode < 41)) && !this.mOpen)
this.openPopup(); this.showPopup();
]]></handler> ]]></handler>
<handler event="mousedown"><![CDATA[ <handler event="mousedown"><![CDATA[
@ -551,7 +551,7 @@
// get it to recognize the popupalign and popupanchor attributes that way // get it to recognize the popupalign and popupanchor attributes that way
// So, I have to do it manually... // So, I have to do it manually...
this.focus(); this.focus();
this.openPopup(); this.showPopup();
]]></handler> ]]></handler>
</handlers> </handlers>
</binding> </binding>

Просмотреть файл

@ -420,7 +420,7 @@
if (!popups[0].hasAttribute("open")) { if (!popups[0].hasAttribute("open")) {
event.preventDefault(); event.preventDefault();
popups[0].openPopup(this, -1, -1, "popup", "bottomleft", "topleft"); popups[0].showPopup(this, -1, -1, "popup", "bottomleft", "topleft");
this._selectInputFieldValueInList(); this._selectInputFieldValueInList();
} }

Просмотреть файл

@ -39,8 +39,7 @@
</getter> </getter>
</property> </property>
<!-- XXXben should become showPopup --> <method name="showPopup">
<method name="openPopup">
<parameter name="element"/> <parameter name="element"/>
<parameter name="xpos"/> <parameter name="xpos"/>
<parameter name="ypos"/> <parameter name="ypos"/>
@ -65,8 +64,7 @@
</body> </body>
</method> </method>
<!-- XXXben should become hidePopup --> <method name="hidePopup">
<method name="closePopup">
<body> <body>
<![CDATA[ <![CDATA[
var popupBox = null; var popupBox = null;
@ -189,7 +187,7 @@
if (!rel) { if (!rel) {
++this._mouseOutCount; ++this._mouseOutCount;
if (this._mouseOutCount > 1) if (this._mouseOutCount > 1)
this.closePopup(); this.hidePopup();
return; return;
} }
@ -202,7 +200,7 @@
// if the entered node is not a descendant of ours, hide the tooltip // if the entered node is not a descendant of ours, hide the tooltip
if (rel != this && this._isMouseOver) { if (rel != this && this._isMouseOver) {
this.closePopup(); this.hidePopup();
} }
]]></handler> ]]></handler>
@ -225,7 +223,7 @@
// XXX commenting this out for now because it doesn't work on Mac // XXX commenting this out for now because it doesn't work on Mac
// become mouseover isn't fired when the tooltip appears with the mouse over it // become mouseover isn't fired when the tooltip appears with the mouse over it
//if (this.hasAttribute("titletip")) //if (this.hasAttribute("titletip"))
// window.setTimeout(function(me) { if (!me._isMouseOver) me.closePopup(); }, 100, this); // window.setTimeout(function(me) { if (!me._isMouseOver) me.hidePopup(); }, 100, this);
]]> ]]>
</handler> </handler>