зеркало из https://github.com/mozilla/lightbeam.git
Fix prefs
This commit is contained in:
Родитель
ec8046db6c
Коммит
cb30629cb7
|
@ -119,7 +119,6 @@ aggregate.connectionAsObject = function(conn){
|
|||
|
||||
}
|
||||
|
||||
|
||||
function applyFilter(filter){
|
||||
currentFilter = filter;
|
||||
}
|
||||
|
@ -135,15 +134,20 @@ function onLoad(connections){
|
|||
connections.forEach(onConnection);
|
||||
aggregate.initialized = true;
|
||||
filteredAggregate = currentFilter();
|
||||
// Set the contribute data button
|
||||
|
||||
// Tell the visualization that we're ready.
|
||||
currentVisualization.emit('init');
|
||||
updateStatsBar();
|
||||
//console.log('aggregate::onLoad end, took %s ms', Date.now() - startTime);
|
||||
}
|
||||
|
||||
function setPrefs(prefs) {
|
||||
console.log("in aggregate prefs");
|
||||
global.setPrefs(prefs);
|
||||
}
|
||||
|
||||
aggregate.on('load', onLoad);
|
||||
//aggregate.on("setPrefs", setPrefs);
|
||||
aggregate.on("setPrefs", setPrefs);
|
||||
|
||||
// Constants for indexes of properties in array format
|
||||
//const SOURCE = 0;
|
||||
|
|
|
@ -56,8 +56,11 @@ self.port.on("private-browsing", function() {
|
|||
});
|
||||
|
||||
self.port.on("setPrefs", function(prefs) {
|
||||
console.log("Got set prefs", prefs);
|
||||
if (unsafeWindow && unsafeWindow.aggregate) {
|
||||
unsafeWindow.aggregate.emit("setPrefs", prefs);
|
||||
} else {
|
||||
console.error("cannot call aggregate.setPrefs");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
31
data/ui.js
31
data/ui.js
|
@ -159,34 +159,6 @@ document.querySelector('.reset-data').addEventListener('click', function(){
|
|||
});
|
||||
});
|
||||
|
||||
// function handleDisclosureToggle(elem){
|
||||
// console.log('disclosure toggled');
|
||||
// }
|
||||
|
||||
// function handleUserSettingToggle(elem){
|
||||
// console.log('User setting changed');
|
||||
// }
|
||||
|
||||
// document.querySelector('.stage').addEventListener('click', function(event){
|
||||
// // demultiplex "live" event handlers
|
||||
// if (event.target.mozMatchesSelector('.disclosure')){
|
||||
// handleDisclosureToggle(event.target);
|
||||
// event.preventDefault();
|
||||
// event.stopPropagation();
|
||||
// }else if (event.target.mozMatchesSelector('.userSetting')){
|
||||
// handleUserSettingToggle(event.target);
|
||||
// event.stopPropagation();
|
||||
// }else if (event.target.mozMatchesSelector('[type=checkbox]')){
|
||||
// event.stopPropagation();
|
||||
// if (event.target.mozMatchesSelector('selectedHeader')){
|
||||
// // what to do here, select all or sort?
|
||||
// }
|
||||
// }else{
|
||||
// console.log('so what is it, then? %o', event.target);
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
function getZoom(canvas){
|
||||
try{
|
||||
var box = canvas.getAttribute('viewBox')
|
||||
|
@ -505,8 +477,6 @@ function colourHighlightNodes(highlight){
|
|||
}
|
||||
|
||||
function setPrefs(event) {
|
||||
console.log("got set prefs");
|
||||
/*
|
||||
if ("contributeData" in event && event["contributeData"]) {
|
||||
var toggleBtn = document.querySelector(".share-btn");
|
||||
toggleBtn.querySelector("input").checked = true;
|
||||
|
@ -516,5 +486,4 @@ function setPrefs(event) {
|
|||
toggleBtn.querySelector("input").checked = false;
|
||||
toggleBtnOffEffect(toggleBtn);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ function attachToLightbeamPage(worker) {
|
|||
}
|
||||
|
||||
function onPrefChanged(event) {
|
||||
if (contributeData in event) {
|
||||
if ("contributeData" in event) {
|
||||
prefs.contributeData = event["contributeData"];
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ function attachToLightbeamPage(worker) {
|
|||
|
||||
function onUIReady() {
|
||||
worker.port.emit("passStoredConnections", getAllConnections());
|
||||
//worker.port.emit("setPrefs", { contributeData: prefs.contributeData });
|
||||
worker.port.emit("setPrefs", prefs);
|
||||
}
|
||||
|
||||
function onWorkerDetach() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче