Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/sidebar.js

Issue 29329779: Issue 3258 - Blockable items: restore item flashing functionality (Closed)
Patch Set: Created Nov. 5, 2015, 8:52 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/content/ui/sidebar.xul » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/sidebar.js
===================================================================
--- a/chrome/content/ui/sidebar.js
+++ b/chrome/content/ui/sidebar.js
@@ -19,17 +19,16 @@ Cu.import("resource://gre/modules/XPCOMU
// Main browser window
var mainWin = parent;
// The window handler currently in use
var requestNotifier = null;
var cacheStorage = null;
-var noFlash = false;
// Matcher for disabled filters
var disabledMatcher = new CombinedMatcher();
// Cached string values
var docDomainThirdParty = null;
var docDomainFirstParty = null;
@@ -119,17 +118,16 @@ function getFilter(item)
if ("filter" in item && item.filter)
return Filter.fromText(item.filter);
else
return null;
}
// To be called on unload
function cleanUp() {
- flasher.stop();
requestNotifier.shutdown();
FilterNotifier.removeListener(reloadDisabledFilters);
Prefs.removeListener(onPrefChange);
E("list").view = null;
let {removeBrowserLocationListener} = require("appSupport");
if (removeBrowserLocationListener)
removeBrowserLocationListener(mainWin, handleLocationChange);
@@ -193,18 +191,18 @@ function onSelectionChange() {
if (item && window.content)
{
let key = item.location + " " + item.type + " " + item.docDomain;
RequestNotifier.storeSelection(window.content, key);
treeView.itemToSelect = null;
}
- if (!noFlash)
- flasher.flash(item ? item.nodes : null);
+ if (requestNotifier)
+ requestNotifier.flashNodes(item ? item.ids : null, Prefs.flash_scrolltoitem);
}
function handleLocationChange()
{
if (requestNotifier)
requestNotifier.shutdown();
treeView.clearData();
@@ -1084,24 +1082,25 @@ var treeView = {
// Merge duplicate entries
let key = item.location + " " + item.type + " " + item.docDomain;
if (key in this.dataMap)
{
// We know this item already - take over the filter if any and be done with it
let existing = this.dataMap[key];
if (item.filter)
existing.filter = item.filter;
+ existing.ids.push(item.id);
this.invalidateItem(existing);
return;
}
// Add new item to the list
// Store original item in orig property - reading out prototype is messed up in Gecko 1.9.2
- item = {__proto__: item, orig: item, nodes: []};
+ item = {__proto__: item, orig: item, nodes: [], ids: [item.id]};
this.allData.push(item);
this.dataMap[key] = item;
// Show disabled filters if no other filter applies
if (!item.filter)
{
let disabledMatch = disabledMatcher.matchesAny(item.location, RegExpFilter.typeMap[item.type], item.docDomain, item.thirdParty);
if (disabledMatch)
« no previous file with comments | « no previous file | chrome/content/ui/sidebar.xul » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld