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

Side by Side Diff: ext/common.js

Issue 5088751004942336: Issue 370 - Right-clicked element is removed independent of created filter (Closed)
Patch Set: Rebase to rev 3c9cea80c481 Created July 18, 2014, 8:54 a.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 | « ext/background.js ('k') | iconAnimation.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18
19 (function()
20 {
21 window.ext = {};
22
23 var EventTarget = ext._EventTarget = function(cancelable)
24 {
25 this._listeners = [];
26 this._cancelable = cancelable;
27 };
28 EventTarget.prototype = {
29 addListener: function(listener)
30 {
31 if (this._listeners.indexOf(listener) == -1)
32 this._listeners.push(listener);
33 },
34 removeListener: function(listener)
35 {
36 var idx = this._listeners.indexOf(listener);
37 if (idx != -1)
38 this._listeners.splice(idx, 1);
39 },
40 _dispatch: function()
41 {
42 var result = null;
43
44 for (var i = 0; i < this._listeners.length; i++)
45 {
46 result = this._listeners[i].apply(null, arguments);
47
48 if (this._cancelable && result === false)
49 break;
50 }
51
52 return result;
53 }
54 };
55 })();
OLDNEW
« no previous file with comments | « ext/background.js ('k') | iconAnimation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld