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

Unified Diff: popup.js

Issue 29336084: Issue 2426 - Open block.html as a popup window (Closed)
Patch Set: Rebased, replaced search param with proper messaging Created Feb. 17, 2016, 8:04 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
Index: popup.js
diff --git a/popup.js b/popup.js
index 3b5dc9b547f19d6105372b78adcebea38ce0352b..414779f9ca82073795d0faf6080acc27a388be41 100644
--- a/popup.js
+++ b/popup.js
@@ -48,7 +48,7 @@ function onLoad()
if (checkWhitelisted(page))
document.body.classList.add("disabled");
- page.sendMessage({type: "get-clickhide-state"}, function(response)
+ page.sendMessage({type: "blockelement-get-state"}, function(response)
{
if (response && response.active)
document.body.classList.add("clickhide-active");
@@ -84,7 +84,7 @@ function onUnload()
function onMessage(message, sender, callback)
{
- if (message.type == "report-html-page" && sender.page._id == page._id)
+ if (message.type == "report-html-page" && sender.page.id == page.id)
document.body.classList.remove("nohtml");
}
@@ -120,7 +120,7 @@ function toggleEnabled()
function activateClickHide()
{
document.body.classList.add("clickhide-active");
- page.sendMessage({type: "clickhide-activate"});
+ page.sendMessage({type: "blockelement-start-picking-element"});
// Close the popup after a few seconds, so user doesn't have to
activateClickHide.timeout = window.setTimeout(ext.closePopup, 5000);
@@ -134,7 +134,7 @@ function cancelClickHide()
activateClickHide.timeout = null;
}
document.body.classList.remove("clickhide-active");
- page.sendMessage({type: "clickhide-deactivate"});
+ page.sendMessage({type: "blockelement-finished"});
}
function toggleCollapse(event)
« no previous file with comments | « metadata.common ('k') | safari/ext/background.js » ('j') | safari/ext/background.js » ('J')

Powered by Google App Engine
This is Rietveld