mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
b=318439 r=bryner sr=ben
Made insertionPoint for places-bar and places-menupopup inside the folder if the selection is a folder.
This commit is contained in:
parent
624429ce26
commit
ae7f7f2a44
@ -88,7 +88,7 @@
|
||||
if (PlacesController.nodeIsURL(child)) {
|
||||
element = document.createElementNS(XULNS, "menuitem");
|
||||
element.setAttribute("label", child.title);
|
||||
element.setAttribute("url", child.url)
|
||||
element.setAttribute("url", child.url);
|
||||
}
|
||||
else if (PlacesController.nodeIsFolder(child)) {
|
||||
element = document.createElementNS(XULNS, "menu");
|
||||
@ -159,11 +159,21 @@
|
||||
|
||||
<property name="insertionPoint">
|
||||
<getter><![CDATA[
|
||||
if (!this.hasSelection)
|
||||
var index = -1;
|
||||
else
|
||||
index = PlacesController.getIndexOfNode(this.selectedNode)
|
||||
return new InsertionPoint(this._result.folderId, index);
|
||||
// By default, the insertion point is at the top level, at the end.
|
||||
var index = -1;
|
||||
var folderId = this._result.folderId;
|
||||
|
||||
if (this.hasSelection) {
|
||||
if(PlacesController.nodeIsFolder(this.selectedNode))
|
||||
// If there is a folder selected, the insertion point is the
|
||||
// end of the folder.
|
||||
folderId = this.selectedNode.folderId;
|
||||
else
|
||||
// If there is another type of node selected, the insertion point
|
||||
// is after that node.
|
||||
index = PlacesController.getIndexOfNode(this.selectedNode)
|
||||
}
|
||||
return new InsertionPoint(folderId, index);
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
|
@ -119,12 +119,22 @@
|
||||
</property>
|
||||
|
||||
<property name="insertionPoint">
|
||||
<getter><![CDATA[
|
||||
if (!this.hasSelection)
|
||||
var index = -1;
|
||||
else
|
||||
index = PlacesController.getIndexOfNode(this.selectedNode)
|
||||
return new InsertionPoint(this._result.folderId, index);
|
||||
<getter><![CDATA[
|
||||
// By default, the insertion point is at the top level, at the end.
|
||||
var index = -1;
|
||||
var folderId = this._result.folderId;
|
||||
|
||||
if (this.hasSelection) {
|
||||
if(PlacesController.nodeIsFolder(this.selectedNode))
|
||||
// If there is a folder selected, the insertion point is the
|
||||
// end of the folder.
|
||||
folderId = this.selectedNode.folderId;
|
||||
else
|
||||
// If there is another type of node selected, the insertion point
|
||||
// is after that node.
|
||||
index = PlacesController.getIndexOfNode(this.selectedNode)
|
||||
}
|
||||
return new InsertionPoint(folderId, index);
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user