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

Unified Diff: ui/webui/resources/custom_elements/cr/util/cr-util.js

Issue 902053003: Add cr-toggle-button to Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ui/webui/resources/custom_elements/cr/util/cr-util.js
diff --git a/ui/webui/resources/custom_elements/cr/util/cr-util.js b/ui/webui/resources/custom_elements/cr/util/cr-util.js
new file mode 100644
index 0000000000000000000000000000000000000000..df41f006f140dcc7638539cadbd66a4f3e71a71f
--- /dev/null
+++ b/ui/webui/resources/custom_elements/cr/util/cr-util.js
@@ -0,0 +1,30 @@
+/* Copyright 2015 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file. */
+
+/**
+ * @fileoverview
+ * `cr-util` provides utility functions for Chrome custom elements.
+ *
+ * Example:
+ *
+ * <cr-util></cr-util>
+ *
+ * @element cr-util
Jeremy Klein 2015/02/05 23:42:11 I'd like to keep this name a little bit more well-
michaelpg 2015/02/06 08:55:43 Done.
+ */
+Polymer({
+ /**
+ * Forwards events that don't automatically cross the shadow boundary
+ * if the event should bubble.
+ * @param {!Event} e The event to forward.
+ * @param {*} detail Data passed when initializing the event.
+ * @param {Node=} sender Node that declared the handler.
+ */
+ forwardEvent: function(e, detail, sender) {
+ // TODO
Jeremy Klein 2015/02/05 23:42:11 What should this TODO say?
michaelpg 2015/02/06 08:55:43 Fixed
+ if (e.bubbles && sender &&
+ e.path[e.path.length - 1] == sender.shadowRoot) {
+ sender.fire(e.type, detail, e.target, true, e.cancelable);
+ }
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698