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); |
+ } |
+ }, |
+}); |