From a1be17c1cea81ebb1e8b131a662c698d78f3f7f2 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 4 Jun 2018 13:17:38 +0200 Subject: Issue #303 Part 1: Move basilisk files from /browser to /application/basilisk --- .../basilisk/components/places/content/tree.xml | 801 +++++++++++++++++++++ 1 file changed, 801 insertions(+) create mode 100644 application/basilisk/components/places/content/tree.xml (limited to 'application/basilisk/components/places/content/tree.xml') diff --git a/application/basilisk/components/places/content/tree.xml b/application/basilisk/components/places/content/tree.xml new file mode 100644 index 000000000..338ee81f6 --- /dev/null +++ b/application/basilisk/components/places/content/tree.xml @@ -0,0 +1,801 @@ + + + + + + + + + + + result->treeviewer cycle. + // Note: unsetting the result's viewer also unsets + // the viewer's reference to our treeBoxObject. + var result = this.result; + if (result) { + result.root.containerOpen = false; + } + + // Unregister the controllber before unlinking the view, otherwise it + // may still try to update commands on a view with a null result. + if (this._controller) { + this._controller.terminate(); + this.controllers.removeController(this._controller); + } + + this.view = null; + ]]> + + + + + + + + + + + + + + + + + + + + + + 0) { + treeView.selection.select(0); + } + + this._cachedInsertionPoint = undefined; + ]]> + + + + + + + + + + + + + + + + + + + + + + = 0; --i) { + let index = view.treeIndexForNode(parents[i]); + if (index != Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE && + view.isContainer(index) && !view.isContainerOpen(index)) + view.toggleOpenState(index); + } + // Select the specified node... + } + + let index = view.treeIndexForNode(node); + if (index == Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE) + return; + + view.selection.select(index); + // ... and ensure it's visible, not scrolled off somewhere. + this.treeBoxObject.ensureRowIsVisible(index); + ]]> + + + + + + + + + + + + + + + + = 1; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0; + child++) { + var childNode = node.getChild(child); + var found = findNodes(childNode); + if (!foundOne) + foundOne = found; + } + + // If we didn't find any additional matches in this node's + // subtree, revert the node to its previous openness. + if (foundOne) + nodesToOpen.unshift(node); + node.containerOpen = previousOpenness; + return foundOne; + } + + // Disable notifications while looking for nodes. + let result = this.result; + let didSuppressNotifications = result.suppressNotifications; + if (!didSuppressNotifications) + result.suppressNotifications = true + try { + findNodes(this.result.root); + } + finally { + if (!didSuppressNotifications) + result.suppressNotifications = false; + } + + // For all the nodes we've found, highlight the corresponding + // index in the tree. + var resultview = this.view; + var selection = this.view.selection; + selection.selectEventsSuppressed = true; + selection.clearSelection(); + // Open nodes containing found items + for (let i = 0; i < nodesToOpen.length; i++) { + nodesToOpen[i].containerOpen = true; + } + for (let i = 0; i < nodes.length; i++) { + var index = resultview.treeIndexForNode(nodes[i]); + if (index == Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE) + continue; + selection.rangedSelect(index, index, true); + } + selection.selectEventsSuppressed = false; + ]]> + + + false + + + + + + + + + this._contextMenuShown = false; + + + + + + true + + + + + + + + + + rowHeight * 0.75) { + // If we are below the 75% of a container the treeview we try + // to drop after the node. + orientation = Ci.nsITreeView.DROP_AFTER; + } + else if (PlacesUtils.nodeIsContainer(node) && + eventY > rowHeight * 0.25) { + // If we are below the 25% of a container the treeview we try + // to drop inside the node. + orientation = Ci.nsITreeView.DROP_ON; + } + + if (!this.view.canDrop(cell.row, orientation, event.dataTransfer)) + return; + + event.preventDefault(); + event.stopPropagation(); + ]]> + + + + + + + -- cgit v1.2.3