mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 419549 - click bookmark item does not work. r=mak77, a~post-facto, see comment 6.
This commit is contained in:
parent
0696bc4649
commit
bba9529cf7
@ -582,12 +582,12 @@ var BookmarksEventHandler = {
|
||||
|
||||
var target = aEvent.originalTarget;
|
||||
var view = PlacesUtils.getViewForNode(target);
|
||||
if (PlacesUtils.nodeIsFolder(view.selectedNode)) {
|
||||
if (target.node && PlacesUtils.nodeIsFolder(target.node)) {
|
||||
// Don't open the root folder in tabs when the empty area on the toolbar
|
||||
// is middle-clicked or when a non-bookmark item except for Open in Tabs)
|
||||
// in a bookmarks menupopup is middle-clicked.
|
||||
if (!view.controller.rootNodeIsSelected())
|
||||
view.controller.openSelectionInTabs(aEvent);
|
||||
if (target.localName == "menu" || target.localName == "toolbarbutton")
|
||||
PlacesUtils.openContainerNodeInTabs(target.node, aEvent);
|
||||
}
|
||||
else
|
||||
this.onCommand(aEvent);
|
||||
@ -624,11 +624,8 @@ var BookmarksEventHandler = {
|
||||
*/
|
||||
onCommand: function BM_onCommand(aEvent) {
|
||||
var target = aEvent.originalTarget;
|
||||
if (target.node) {
|
||||
PlacesUtils.getViewForNode(target)
|
||||
.controller
|
||||
.openSelectedNodeWithEvent(aEvent);
|
||||
}
|
||||
if (target.node)
|
||||
PlacesUtils.openNodeWithEvent(target.node, aEvent);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -72,8 +72,8 @@
|
||||
flex="1"
|
||||
hidecolumnpicker="true"
|
||||
context="placesContext"
|
||||
onkeypress="if (event.keyCode == 13) this.controller.openSelectedNodeWithEvent(event);"
|
||||
onclick="SidebarUtils.handleClick(this, event);"
|
||||
onkeypress="SidebarUtils.handleTreeKeyPress(event);"
|
||||
onclick="SidebarUtils.handleTreeClick(this, event);"
|
||||
onmousemove="SidebarUtils.handleTreeMouseMove(event);"
|
||||
onmouseout="SidebarUtils.clearURLFromStatusBar();">
|
||||
<treecols>
|
||||
|
@ -213,13 +213,13 @@ PlacesController.prototype = {
|
||||
this.selectAll();
|
||||
break;
|
||||
case "placesCmd_open":
|
||||
this.openSelectedNodeIn("current");
|
||||
PlacesUtils.openNodeIn(this._view.selectedNode, "current");
|
||||
break;
|
||||
case "placesCmd_open:window":
|
||||
this.openSelectedNodeIn("window");
|
||||
PlacesUtils.openNodeIn(this._view.selectedNode, "window");
|
||||
break;
|
||||
case "placesCmd_open:tab":
|
||||
this.openSelectedNodeIn("tab");
|
||||
PlacesUtils.openNodeIn(this._view.selectedNode, "tab");
|
||||
break;
|
||||
case "placesCmd_new:folder":
|
||||
this.newItem("folder");
|
||||
@ -612,50 +612,6 @@ PlacesController.prototype = {
|
||||
this._view.selectAll();
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the selected node's URL in the appropriate tab or window or as a web
|
||||
* panel given the user's preference specified by modifier keys tracked by a
|
||||
* DOM mouse/key event.
|
||||
* @param aEvent
|
||||
* The DOM mouse/key event with modifier keys set that track the
|
||||
* user's preferred destination window or tab.
|
||||
*/
|
||||
openSelectedNodeWithEvent: function PC_openSelectedNodeWithEvent(aEvent) {
|
||||
this.openSelectedNodeIn(whereToOpenLink(aEvent));
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the selected node's URL in the appropriate tab or window or as a
|
||||
* web panel.
|
||||
* see also openUILinkIn
|
||||
*/
|
||||
openSelectedNodeIn: function PC_openSelectedNodeIn(aWhere) {
|
||||
var node = this._view.selectedNode;
|
||||
if (node && PlacesUtils.nodeIsURI(node) &&
|
||||
PlacesUtils.checkURLSecurity(node)) {
|
||||
var isBookmark = PlacesUtils.nodeIsBookmark(node);
|
||||
|
||||
if (isBookmark)
|
||||
PlacesUtils.markPageAsFollowedBookmark(node.uri);
|
||||
else
|
||||
PlacesUtils.markPageAsTyped(node.uri);
|
||||
|
||||
// Check whether the node is a bookmark which should be opened as
|
||||
// a web panel
|
||||
if (aWhere == "current" && isBookmark) {
|
||||
if (PlacesUtils.annotations
|
||||
.itemHasAnnotation(node.itemId, LOAD_IN_SIDEBAR_ANNO)) {
|
||||
var w = getTopWin();
|
||||
if (w) {
|
||||
w.openWebPanel(node.title, node.uri);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
openUILinkIn(node.uri, aWhere);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Opens the bookmark properties for the selected URI Node.
|
||||
*/
|
||||
|
@ -119,9 +119,9 @@
|
||||
flex="1"
|
||||
type="places"
|
||||
context="placesContext"
|
||||
onkeypress="if (event.keyCode == 13) this.controller.openSelectedNodeWithEvent(event);"
|
||||
hidecolumnpicker="true"
|
||||
onclick="SidebarUtils.handleClick(this, event, true);"
|
||||
onkeypress="SidebarUtils.handleTreeKeyPress(event);"
|
||||
onclick="SidebarUtils.handleTreeClick(this, event);"
|
||||
onmousemove="SidebarUtils.handleTreeMouseMove(event);"
|
||||
onmouseout="SidebarUtils.clearURLFromStatusBar();">
|
||||
<treecols>
|
||||
|
@ -232,21 +232,19 @@ var PlacesOrganizer = {
|
||||
* The mouse event.
|
||||
*/
|
||||
onTreeClick: function PO_onTreeClick(aEvent) {
|
||||
var currentView = aEvent.currentTarget;
|
||||
var controller = currentView.controller;
|
||||
|
||||
if (aEvent.target.localName != "treechildren")
|
||||
return;
|
||||
|
||||
var currentView = aEvent.currentTarget;
|
||||
var selectedNode = currentView.selectedNode;
|
||||
if (selectedNode && aEvent.button == 1) {
|
||||
if (PlacesUtils.nodeIsURI(currentView.selectedNode))
|
||||
controller.openSelectedNodeWithEvent(aEvent);
|
||||
if (PlacesUtils.nodeIsURI(selectedNode))
|
||||
PlacesUtils.openNodeWithEvent(selectedNode, aEvent);
|
||||
else if (PlacesUtils.nodeIsContainer(selectedNode)) {
|
||||
// The command execution function will take care of seeing the
|
||||
// selection is a folder/container and loading its contents in
|
||||
// tabs for us.
|
||||
controller.openLinksInTabs();
|
||||
PlacesUtils.openContainerNodeInTabs(selectedNode);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -259,7 +257,7 @@ var PlacesOrganizer = {
|
||||
},
|
||||
|
||||
openSelectedNode: function PU_openSelectedNode(aEvent) {
|
||||
this._content.controller.openSelectedNodeWithEvent(aEvent);
|
||||
PlacesUtils.openNodeWithEvent(this._content.selectedNode, aEvent);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
var SidebarUtils = {
|
||||
handleClick: function SU_handleClick(aTree, aEvent, aGutterSelect) {
|
||||
handleTreeClick: function SU_handleTreeClick(aTree, aEvent, aGutterSelect) {
|
||||
var tbo = aTree.treeBoxObject;
|
||||
|
||||
var row = { }, col = { }, obj = { };
|
||||
@ -67,10 +67,15 @@ var SidebarUtils = {
|
||||
// do this *before* attempting to load the link since openURL uses
|
||||
// selection as an indication of which link to load.
|
||||
tbo.view.selection.select(row.value);
|
||||
aTree.controller.openSelectedNodeWithEvent(aEvent);
|
||||
PlacesUtils.openNodeWithEvent(aTree.selectedNode, aEvent);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
handleTreeKeyPress: function SU_handleTreeKeyPress(aEvent) {
|
||||
if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN)
|
||||
PlacesUtils.openNodeWithEvent(aEvent.target.selectedNode, aEvent);
|
||||
},
|
||||
|
||||
/**
|
||||
* The following function displays the URL of a node that is being
|
||||
* hovered over.
|
||||
|
@ -1780,6 +1780,51 @@ var PlacesUtils = {
|
||||
this._openTabset(urlsToOpen, aEvent);
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the node's URL in the appropriate tab or window or as a web
|
||||
* panel given the user's preference specified by modifier keys tracked by a
|
||||
* DOM mouse/key event.
|
||||
* @param aNode
|
||||
* An uri result node.
|
||||
* @param aEvent
|
||||
* The DOM mouse/key event with modifier keys set that track the
|
||||
* user's preferred destination window or tab.
|
||||
*/
|
||||
openNodeWithEvent: function PU_openNodeWithEvent(aNode, aEvent) {
|
||||
this.openNodeIn(aNode, whereToOpenLink(aEvent));
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the node's URL in the appropriate tab or window or as a
|
||||
* web panel.
|
||||
* see also openUILinkIn
|
||||
*/
|
||||
openNodeIn: function PU_openNodeIn(aNode, aWhere) {
|
||||
if (aNode && PlacesUtils.nodeIsURI(aNode) &&
|
||||
PlacesUtils.checkURLSecurity(aNode)) {
|
||||
var isBookmark = PlacesUtils.nodeIsBookmark(aNode);
|
||||
|
||||
if (isBookmark)
|
||||
PlacesUtils.markPageAsFollowedBookmark(aNode.uri);
|
||||
else
|
||||
PlacesUtils.markPageAsTyped(aNode.uri);
|
||||
|
||||
// Check whether the node is a bookmark which should be opened as
|
||||
// a web panel
|
||||
if (aWhere == "current" && isBookmark) {
|
||||
if (PlacesUtils.annotations
|
||||
.itemHasAnnotation(aNode.itemId, LOAD_IN_SIDEBAR_ANNO)) {
|
||||
var w = getTopWin();
|
||||
if (w) {
|
||||
w.openWebPanel(aNode.title, aNode.uri);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
openUILinkIn(aNode.uri, aWhere);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper for the toolbar and menu views
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user