Files
tubestation/browser/components/places/content/bookmarksSidebar.js
Mark Banner bcb5601b9f Bug 824502 - Change folder=<id> to parent=<guid> in Places' bookmark queries. r=mak
This allows queries to be stable across devices, and requires less work to obtain the ids.

MozReview-Commit-ID: 5KAKKags7o9
2018-04-26 09:05:00 +01:00

29 lines
1.0 KiB
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
function init() {
let uidensity = window.top.document.documentElement.getAttribute("uidensity");
if (uidensity) {
document.documentElement.setAttribute("uidensity", uidensity);
}
document.getElementById("bookmarks-view").place =
"place:type=" + Ci.nsINavHistoryQueryOptions.RESULTS_AS_ROOTS_QUERY;
}
function searchBookmarks(aSearchString) {
var tree = document.getElementById("bookmarks-view");
if (!aSearchString)
tree.place = tree.place;
else
tree.applyFilter(aSearchString,
PlacesUtils.bookmarks.userContentRoots);
}
window.addEventListener("SidebarFocused",
() => document.getElementById("search-box").focus());