BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / resources / pdf / elements / viewer-zoom-toolbar / viewer-zoom-toolbar.js
blob8a7f1daff9a80af683e0134bd9bc9170c8c92039
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
3 // found in the LICENSE file.
5 (function() {
7   var FIT_TO_PAGE = 0;
8   var FIT_TO_WIDTH = 1;
10   Polymer({
11     is: 'viewer-zoom-toolbar',
13     properties: {
14       visible_: {
15         type: Boolean,
16         value: true
17       }
18     },
20     fitToggle: function() {
21       if (this.$['fit-button'].activeIndex == FIT_TO_WIDTH)
22         this.fire('fit-to-width');
23       else
24         this.fire('fit-to-page');
25     },
27     zoomIn: function() {
28       this.fire('zoom-in');
29     },
31     zoomOut: function() {
32       this.fire('zoom-out');
33     },
35     show: function() {
36       if (!this.visible_) {
37         this.visible_ = true;
38         this.$['fit-button'].show();
39         this.$['zoom-in-button'].show();
40         this.$['zoom-out-button'].show();
41       }
42     },
44     hide: function() {
45       if (this.visible_) {
46         this.visible_ = false;
47         this.$['fit-button'].hide();
48         this.$['zoom-in-button'].hide();
49         this.$['zoom-out-button'].hide();
50       }
51     },
52   });
54 })();