| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function() { | 5 (function() { |
| 6 | 6 |
| 7 var FIT_TO_PAGE = 0; | 7 var FIT_TO_PAGE = 0; |
| 8 var FIT_TO_WIDTH = 1; | 8 var FIT_TO_WIDTH = 1; |
| 9 | 9 |
| 10 Polymer({ | 10 Polymer({ |
| 11 is: 'viewer-zoom-toolbar', | 11 is: 'viewer-zoom-toolbar', |
| 12 | 12 |
| 13 properties: { | 13 properties: { |
| 14 strings: { | 14 strings: {type: Object, observer: 'updateTooltips_'}, |
| 15 type: Object, | |
| 16 observer: 'updateTooltips_' | |
| 17 }, | |
| 18 | 15 |
| 19 visible_: { | 16 visible_: {type: Boolean, value: true} |
| 20 type: Boolean, | |
| 21 value: true | |
| 22 } | |
| 23 }, | 17 }, |
| 24 | 18 |
| 25 isVisible: function() { | 19 isVisible: function() { |
| 26 return this.visible_; | 20 return this.visible_; |
| 27 }, | 21 }, |
| 28 | 22 |
| 29 /** | 23 /** |
| 30 * @private | 24 * @private |
| 31 * Change button tooltips to match any changes to localized strings. | 25 * Change button tooltips to match any changes to localized strings. |
| 32 */ | 26 */ |
| 33 updateTooltips_: function() { | 27 updateTooltips_: function() { |
| 34 this.$['fit-button'].tooltips = [ | 28 this.$['fit-button'].tooltips = |
| 35 this.strings.tooltipFitToPage, | 29 [this.strings.tooltipFitToPage, this.strings.tooltipFitToWidth]; |
| 36 this.strings.tooltipFitToWidth | |
| 37 ]; | |
| 38 this.$['zoom-in-button'].tooltips = [this.strings.tooltipZoomIn]; | 30 this.$['zoom-in-button'].tooltips = [this.strings.tooltipZoomIn]; |
| 39 this.$['zoom-out-button'].tooltips = [this.strings.tooltipZoomOut]; | 31 this.$['zoom-out-button'].tooltips = [this.strings.tooltipZoomOut]; |
| 40 }, | 32 }, |
| 41 | 33 |
| 42 /** | 34 /** |
| 43 * Handle clicks of the fit-button. | 35 * Handle clicks of the fit-button. |
| 44 */ | 36 */ |
| 45 fitToggle: function() { | 37 fitToggle: function() { |
| 46 if (this.$['fit-button'].activeIndex == FIT_TO_WIDTH) | 38 if (this.$['fit-button'].activeIndex == FIT_TO_WIDTH) |
| 47 this.fire('fit-to-width'); | 39 this.fire('fit-to-width'); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 if (this.visible_) { | 82 if (this.visible_) { |
| 91 this.visible_ = false; | 83 this.visible_ = false; |
| 92 this.$['fit-button'].hide(); | 84 this.$['fit-button'].hide(); |
| 93 this.$['zoom-in-button'].hide(); | 85 this.$['zoom-in-button'].hide(); |
| 94 this.$['zoom-out-button'].hide(); | 86 this.$['zoom-out-button'].hide(); |
| 95 } | 87 } |
| 96 }, | 88 }, |
| 97 }); | 89 }); |
| 98 | 90 |
| 99 })(); | 91 })(); |
| OLD | NEW |