| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> | 9 --> |
| 10 | 10 |
| 11 <link rel="import" href="../polymer/polymer.html"> | 11 <link rel="import" href="../polymer/polymer.html"> |
| 12 | 12 |
| 13 <script> | 13 <script> |
| 14 /** | 14 /** |
| 15 `IronResizableBehavior` is a behavior that can be used in Polymer elements to | 15 * `IronResizableBehavior` is a behavior that can be used in Polymer elements
to |
| 16 coordinate the flow of resize events between "resizers" (elements that control
the | 16 * coordinate the flow of resize events between "resizers" (elements that cont
rol the |
| 17 size or hidden state of their children) and "resizables" (elements that need t
o be | 17 * size or hidden state of their children) and "resizables" (elements that nee
d to be |
| 18 notified when they are resized or un-hidden by their parents in order to take | 18 * notified when they are resized or un-hidden by their parents in order to ta
ke |
| 19 action on their new measurements). | 19 * action on their new measurements). |
| 20 Elements that perform measurement should add the `IronResizableBehavior` behav
ior to | 20 * Elements that perform measurement should add the `IronResizableBehavior` be
havior to |
| 21 their element definition and listen for the `iron-resize` event on themselves. | 21 * their element definition and listen for the `iron-resize` event on themselv
es. |
| 22 This event will be fired when they become showing after having been hidden, | 22 * This event will be fired when they become showing after having been hidden, |
| 23 when they are resized explicitly by another resizable, or when the window has
been | 23 * when they are resized explicitly by another resizable, or when the window h
as been |
| 24 resized. | 24 * resized. |
| 25 Note, the `iron-resize` event is non-bubbling. | 25 * Note, the `iron-resize` event is non-bubbling. |
| 26 @group Polymer Behaviors | 26 * |
| 27 @element iron-resizable-behavior | 27 * @polymerBehavior Polymer.IronResizableBehavior |
| 28 @homepage github.io | 28 * @demo demo/index.html |
| 29 */ | 29 **/ |
| 30 Polymer.IronResizableBehavior = { | 30 Polymer.IronResizableBehavior = { |
| 31 properties: { | 31 properties: { |
| 32 _parentResizable: { | 32 _parentResizable: { |
| 33 type: Object, | 33 type: Object, |
| 34 observer: '_parentResizableChanged' | 34 observer: '_parentResizableChanged' |
| 35 } | 35 } |
| 36 }, | 36 }, |
| 37 | 37 |
| 38 listeners: { | 38 listeners: { |
| 39 'iron-request-resize-notifications': '_onIronRequestResizeNotifications' | 39 'iron-request-resize-notifications': '_onIronRequestResizeNotifications' |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 this._interestedResizables.push(target); | 130 this._interestedResizables.push(target); |
| 131 } | 131 } |
| 132 | 132 |
| 133 target.assignParentResizable(this); | 133 target.assignParentResizable(this); |
| 134 | 134 |
| 135 event.stopPropagation(); | 135 event.stopPropagation(); |
| 136 } | 136 } |
| 137 }; | 137 }; |
| 138 </script> | 138 </script> |
| 139 | 139 |
| OLD | NEW |