| OLD | NEW |
| (Empty) |
| 1 | |
| 2 | |
| 3 (function() { | |
| 4 | |
| 5 Polymer('core-toolbar', { | |
| 6 | |
| 7 /** | |
| 8 * Controls how the items are aligned horizontally. | |
| 9 * Options are `start`, `center`, `end`, `between` and `around`. | |
| 10 * | |
| 11 * @attribute justify | |
| 12 * @type string | |
| 13 * @default '' | |
| 14 */ | |
| 15 justify: '', | |
| 16 | |
| 17 /** | |
| 18 * Controls how the items are aligned horizontally when they are placed | |
| 19 * in the middle. | |
| 20 * Options are `start`, `center`, `end`, `between` and `around`. | |
| 21 * | |
| 22 * @attribute middleJustify | |
| 23 * @type string | |
| 24 * @default '' | |
| 25 */ | |
| 26 middleJustify: '', | |
| 27 | |
| 28 /** | |
| 29 * Controls how the items are aligned horizontally when they are placed | |
| 30 * at the bottom. | |
| 31 * Options are `start`, `center`, `end`, `between` and `around`. | |
| 32 * | |
| 33 * @attribute bottomJustify | |
| 34 * @type string | |
| 35 * @default '' | |
| 36 */ | |
| 37 bottomJustify: '', | |
| 38 | |
| 39 justifyChanged: function(old) { | |
| 40 this.updateBarJustify(this.$.topBar, this.justify, old); | |
| 41 }, | |
| 42 | |
| 43 middleJustifyChanged: function(old) { | |
| 44 this.updateBarJustify(this.$.middleBar, this.middleJustify, old); | |
| 45 }, | |
| 46 | |
| 47 bottomJustifyChanged: function(old) { | |
| 48 this.updateBarJustify(this.$.bottomBar, this.bottomJustify, old); | |
| 49 }, | |
| 50 | |
| 51 updateBarJustify: function(bar, justify, old) { | |
| 52 if (old) { | |
| 53 bar.removeAttribute(this.toLayoutAttrName(old)); | |
| 54 } | |
| 55 if (justify) { | |
| 56 bar.setAttribute(this.toLayoutAttrName(justify), ''); | |
| 57 } | |
| 58 }, | |
| 59 | |
| 60 toLayoutAttrName: function(value) { | |
| 61 return value === 'between' ? 'justified' : value + '-justified'; | |
| 62 } | |
| 63 | |
| 64 }); | |
| 65 | |
| 66 })(); | |
| 67 | |
| OLD | NEW |