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

Unified Diff: composer.postload.js

Issue 29697671: Issue 6183 - Avoid attempting to close the composer popup twice (Closed)
Patch Set: Created Feb. 14, 2018, 4:18 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 | « composer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: composer.postload.js
diff --git a/composer.postload.js b/composer.postload.js
index c5d6ade73a687a52a1341575b0924d2c3decd61f..2a5d1666aca1f22a4af216f4bfa1bcd9b1eee2b8 100644
--- a/composer.postload.js
+++ b/composer.postload.js
@@ -441,12 +441,12 @@ function stopPickingElement()
/* Core logic */
// We're done with the block element feature for now, tidy everything up.
-function deactivateBlockElement()
+function deactivateBlockElement(popupAlreadyClosed)
{
if (currentlyPickingElement)
stopPickingElement();
- if (blockelementPopupId != null)
+ if (blockelementPopupId != null && !popupAlreadyClosed)
{
browser.runtime.sendMessage({
type: "forward",
@@ -456,10 +456,9 @@ function deactivateBlockElement()
type: "composer.dialog.close"
}
});
-
- blockelementPopupId = null;
}
+ blockelementPopupId = null;
lastRightClickEvent = null;
if (currentElement)
@@ -546,7 +545,7 @@ function initializeComposer()
// Apply added element hiding filters.
elemhide.apply();
}
- deactivateBlockElement();
+ deactivateBlockElement(!!message.popupAlreadyClosed);
break;
case "composer.content.clearPreviousRightClickEvent":
if (!lastRightClickEventIsMostRecent)
@@ -566,7 +565,8 @@ function initializeComposer()
type: "forward",
payload:
{
- type: "composer.content.finished"
+ type: "composer.content.finished",
+ popupAlreadyClosed: true
Manish Jethani 2018/02/20 11:17:30 We could just call this "dialogClosed" (instead of
kzar 2018/02/20 11:56:44 FWIW I prefer popupAlreadyClosed so I went with th
Manish Jethani 2018/02/20 12:33:25 Sounds good, thanks.
}
});
}
« no previous file with comments | « composer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld