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

Unified Diff: polymer_1.0.4/bower_components/iron-signals/iron-signals.html

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 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: polymer_1.0.4/bower_components/iron-signals/iron-signals.html
diff --git a/polymer_0.4.0/bower_components/core-signals/core-signals.html b/polymer_1.0.4/bower_components/iron-signals/iron-signals.html
similarity index 60%
copy from polymer_0.4.0/bower_components/core-signals/core-signals.html
copy to polymer_1.0.4/bower_components/iron-signals/iron-signals.html
index d742b090fdd897aed57c96164467abe47f2e7aa5..dcf2e5941821b69b8c068d55aeb6e457b528af80 100644
--- a/polymer_0.4.0/bower_components/core-signals/core-signals.html
+++ b/polymer_1.0.4/bower_components/iron-signals/iron-signals.html
@@ -1,48 +1,46 @@
<!--
-Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
-This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
-The complete set of authors may be found at http://polymer.github.io/AUTHORS
-The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
-subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
-<!--
-`core-signals` provides basic publish-subscribe functionality.
+<script>
+(function(){
+/**
+`iron-signals` provides basic publish-subscribe functionality.
-Note: avoid using `core-signals` whenever you can use
+Note: avoid using `iron-signals` whenever you can use
a controller (parent element) to mediate communication
instead.
-To send a signal, fire a custom event of type `core-signal`, with
+To send a signal, fire a custom event of type `iron-signal`, with
a detail object containing `name` and `data` fields.
- this.fire('core-signal', {name: 'hello', data: null});
-
-To receive a signal, listen for `core-signal-<name>` event on a
-`core-signal` element.
+ this.fire('iron-signal', {name: 'hello', data: null});
- <core-signal on-core-signal-hello="{{helloSignal}}">
+To receive a signal, listen for `iron-signal-<name>` event on a
+`iron-signals` element.
-You can fire a signal event from anywhere, and all
-`core-signal` elements will receive the event, regardless
+ <iron-signals on-iron-signal-hello="{{helloSignal}}">
+
+You can fire a signal event from anywhere, and all
+`iron-signals` elements will receive the event, regardless
of where they are in DOM.
-@group Polymer Core Elements
-@element core-signals
-@status stable
-@homepage github.io
--->
-<polymer-element name="core-signals">
-<script>
-(function(){
-
+@demo demo/index.html
+*/
Polymer({
+ is: 'iron-signals',
+
attached: function() {
signals.push(this);
},
- removed: function() {
+ detached: function() {
var i = signals.indexOf(this);
if (i >= 0) {
signals.splice(i, 1);
@@ -56,10 +54,10 @@ of where they are in DOM.
// signal dispatcher
function notify(name, data) {
// convert generic-signal event to named-signal event
- var signal = new CustomEvent('core-signal-' + name, {
+ var signal = new CustomEvent('iron-signal-' + name, {
// if signals bubble, it's easy to get confusing duplicates
// (1) listen on a container on behalf of local child
- // (2) some deep child ignores the event and it bubbles
+ // (2) some deep child ignores the event and it bubbles
// up to said container
// (3) local child event bubbles up to container
// also, for performance, we avoid signals flying up the
@@ -75,10 +73,9 @@ of where they are in DOM.
}
// signal listener at document
- document.addEventListener('core-signal', function(e) {
+ document.addEventListener('iron-signal', function(e) {
notify(e.detail.name, e.detail.data);
});
-
+
})();
</script>
-</polymer-element>
« no previous file with comments | « polymer_1.0.4/bower_components/iron-signals/index.html ('k') | polymer_1.0.4/bower_components/iron-test-helpers/.bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698