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

Side by Side Diff: composer.js

Issue 29697671: Issue 6183 - Avoid attempting to close the composer popup twice (Closed)
Patch Set: Created Feb. 14, 2018, 4:18 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | composer.postload.js » ('j') | composer.postload.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 function closeDialog(success) 64 function closeDialog(success)
65 { 65 {
66 browser.runtime.sendMessage({ 66 browser.runtime.sendMessage({
67 type: "forward", 67 type: "forward",
68 targetPageId, 68 targetPageId,
69 payload: 69 payload:
70 { 70 {
71 type: "composer.content.finished", 71 type: "composer.content.finished",
72 popupAlreadyClosed: true,
72 remove: (typeof success == "boolean" ? success : false) 73 remove: (typeof success == "boolean" ? success : false)
73 } 74 }
74 }); 75 });
75 closeMe(); 76 closeMe();
76 } 77 }
77 78
78 function init() 79 function init()
79 { 80 {
80 // Attach event listeners 81 // Attach event listeners
81 window.addEventListener("keydown", onKeyDown, false); 82 window.addEventListener("keydown", onKeyDown, false);
(...skipping 30 matching lines...) Expand all
112 break; 113 break;
113 case "composer.dialog.close": 114 case "composer.dialog.close":
114 closeMe(); 115 closeMe();
115 break; 116 break;
116 } 117 }
117 }); 118 });
118 119
119 window.removeEventListener("load", init); 120 window.removeEventListener("load", init);
120 } 121 }
121 window.addEventListener("load", init, false); 122 window.addEventListener("load", init, false);
OLDNEW
« no previous file with comments | « no previous file | composer.postload.js » ('j') | composer.postload.js » ('J')

Powered by Google App Engine
This is Rietveld