Chromium Code Reviews| 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: { | |
| 15 type: Object, | |
| 16 observer: 'updateTooltips_' | |
| 17 }, | |
| 18 | |
| 14 visible_: { | 19 visible_: { |
| 15 type: Boolean, | 20 type: Boolean, |
| 16 value: true | 21 value: true |
| 17 } | 22 } |
| 18 }, | 23 }, |
| 19 | 24 |
| 20 isVisible: function() { | 25 isVisible: function() { |
| 21 return this.visible_; | 26 return this.visible_; |
| 22 }, | 27 }, |
| 23 | 28 |
| 24 /** | 29 /** |
| 25 * Change button tooltips to match any changes to loadTimeData. | 30 * Change button tooltips to match any changes to loadTimeData. |
|
raymes
2016/07/12 05:21:49
is this comment still accurate?
tsergeant
2016/07/12 06:11:39
Not quite, I've tweaked it to reflect the changes.
| |
| 26 */ | 31 */ |
| 27 updateTooltips: function() { | 32 updateTooltips_: function() { |
| 28 this.$['fit-button'].tooltips = [ | 33 this.$['fit-button'].tooltips = [ |
| 29 loadTimeData.getString('tooltipFitToPage'), | 34 this.strings.tooltipFitToPage, |
| 30 loadTimeData.getString('tooltipFitToWidth') | 35 this.strings.tooltipFitToWidth |
| 31 ]; | 36 ]; |
| 32 this.$['zoom-in-button'].tooltips = | 37 this.$['zoom-in-button'].tooltips = [this.strings.tooltipZoomIn]; |
| 33 [loadTimeData.getString('tooltipZoomIn')]; | 38 this.$['zoom-out-button'].tooltips = [this.strings.tooltipZoomOut]; |
| 34 this.$['zoom-out-button'].tooltips = | |
| 35 [loadTimeData.getString('tooltipZoomOut')]; | |
| 36 }, | 39 }, |
| 37 | 40 |
| 38 fitToggle: function() { | 41 fitToggle: function() { |
| 39 if (this.$['fit-button'].activeIndex == FIT_TO_WIDTH) | 42 if (this.$['fit-button'].activeIndex == FIT_TO_WIDTH) |
| 40 this.fire('fit-to-width'); | 43 this.fire('fit-to-width'); |
| 41 else | 44 else |
| 42 this.fire('fit-to-page'); | 45 this.fire('fit-to-page'); |
| 43 }, | 46 }, |
| 44 | 47 |
| 45 zoomIn: function() { | 48 zoomIn: function() { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 63 if (this.visible_) { | 66 if (this.visible_) { |
| 64 this.visible_ = false; | 67 this.visible_ = false; |
| 65 this.$['fit-button'].hide(); | 68 this.$['fit-button'].hide(); |
| 66 this.$['zoom-in-button'].hide(); | 69 this.$['zoom-in-button'].hide(); |
| 67 this.$['zoom-out-button'].hide(); | 70 this.$['zoom-out-button'].hide(); |
| 68 } | 71 } |
| 69 }, | 72 }, |
| 70 }); | 73 }); |
| 71 | 74 |
| 72 })(); | 75 })(); |
| OLD | NEW |