Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ui/webui/resources/cr_elements/cr_events/cr-events.js

Issue 902053003: Add cr-toggle-button to Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more renames; add to chrome://md-settings Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright 2015 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
4
5 /**
6 * @fileoverview
7 * `cr-events` provides helpers for handling events in Chrome Polymer elements.
8 *
9 * Example:
10 *
11 * <cr-events></cr-events>
12 *
13 * @element cr-events
14 */
15 Polymer({
16 /**
17 * Forwards events that don't automatically cross the shadow boundary
18 * if the event should bubble.
19 * @param {!Event} e The event to forward.
20 * @param {*} detail Data passed when initializing the event.
21 * @param {Node=} sender Node that declared the handler.
22 */
23 forwardEvent: function(e, detail, sender) {
24 if (!e.bubbles)
25 return;
26
27 var node = e.path[e.path.length - 1];
28 if (node instanceof ShadowRoot) {
29 // Forward the event to the shadow host.
30 e.stopPropagation();
31 node.host.fire(e.type, detail, node.host, true, e.cancelable);
32 }
33 },
34 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698