summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-09-18 14:34:04 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-10-04 11:15:27 +0000
commite6430e577f105ad8813c92e75c54660c4985026e (patch)
tree88115e5d1fb471fea807111924dcccbeadbf9e4f /chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
parent53d399fe6415a96ea6986ec0d402a9c07da72453 (diff)
BASELINE: Update Chromium to 61.0.3163.99
Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js')
-rw-r--r--chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js243
1 files changed, 112 insertions, 131 deletions
diff --git a/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js b/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
index d4e8cbd6637..07b03909149 100644
--- a/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
+++ b/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.js
@@ -2,145 +2,126 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(function() {
- Polymer({
- is: 'viewer-pdf-toolbar',
-
- behaviors: [
- Polymer.NeonAnimationRunnerBehavior
- ],
-
- properties: {
- /**
- * The current loading progress of the PDF document (0 - 100).
- */
- loadProgress: {
- type: Number,
- observer: 'loadProgressChanged'
- },
-
- /**
- * The title of the PDF document.
- */
- docTitle: String,
-
- /**
- * The number of the page being viewed (1-based).
- */
- pageNo: Number,
-
- /**
- * Tree of PDF bookmarks (or null if the document has no bookmarks).
- */
- bookmarks: {
- type: Object,
- value: null
- },
-
- /**
- * The number of pages in the PDF document.
- */
- docLength: Number,
-
- /**
- * Whether the toolbar is opened and visible.
- */
- opened: {
- type: Boolean,
- value: true
- },
-
- strings: Object,
-
- animationConfig: {
- value: function() {
- return {
- 'entry': {
- name: 'transform-animation',
- node: this,
- transformFrom: 'translateY(-100%)',
- transformTo: 'translateY(0%)',
- timing: {
- easing: 'cubic-bezier(0, 0, 0.2, 1)',
- duration: 250
- }
- },
- 'exit': {
- name: 'slide-up-animation',
- node: this,
- timing: {
- easing: 'cubic-bezier(0.4, 0, 1, 1)',
- duration: 250
- }
- }
- };
- }
+Polymer({
+ is: 'viewer-pdf-toolbar',
+
+ behaviors: [Polymer.NeonAnimationRunnerBehavior],
+
+ properties: {
+ /**
+ * The current loading progress of the PDF document (0 - 100).
+ */
+ loadProgress: {type: Number, observer: 'loadProgressChanged'},
+
+ /**
+ * The title of the PDF document.
+ */
+ docTitle: String,
+
+ /**
+ * The number of the page being viewed (1-based).
+ */
+ pageNo: Number,
+
+ /**
+ * Tree of PDF bookmarks (or null if the document has no bookmarks).
+ */
+ bookmarks: {type: Object, value: null},
+
+ /**
+ * The number of pages in the PDF document.
+ */
+ docLength: Number,
+
+ /**
+ * Whether the toolbar is opened and visible.
+ */
+ opened: {type: Boolean, value: true},
+
+ strings: Object,
+
+ animationConfig: {
+ value: function() {
+ return {
+ 'entry': {
+ name: 'transform-animation',
+ node: this,
+ transformFrom: 'translateY(-100%)',
+ transformTo: 'translateY(0%)',
+ timing: {easing: 'cubic-bezier(0, 0, 0.2, 1)', duration: 250}
+ },
+ 'exit': {
+ name: 'slide-up-animation',
+ node: this,
+ timing: {easing: 'cubic-bezier(0.4, 0, 1, 1)', duration: 250}
+ }
+ };
}
- },
+ }
+ },
- listeners: {
- 'neon-animation-finish': '_onAnimationFinished'
- },
+ listeners: {'neon-animation-finish': '_onAnimationFinished'},
- _onAnimationFinished: function() {
- this.style.transform = this.opened ? 'none' : 'translateY(-100%)';
- },
+ _onAnimationFinished: function() {
+ this.style.transform = this.opened ? 'none' : 'translateY(-100%)';
+ },
- loadProgressChanged: function() {
- if (this.loadProgress >= 100) {
- this.$.pageselector.classList.toggle('invisible', false);
- this.$.buttons.classList.toggle('invisible', false);
- this.$.progress.style.opacity = 0;
- }
- },
+ loadProgressChanged: function() {
+ if (this.loadProgress >= 100) {
+ this.$.pageselector.classList.toggle('invisible', false);
+ this.$.buttons.classList.toggle('invisible', false);
+ this.$.progress.style.opacity = 0;
+ }
+ },
- hide: function() {
- if (this.opened)
- this.toggleVisibility();
- },
+ hide: function() {
+ if (this.opened)
+ this.toggleVisibility();
+ },
- show: function() {
- if (!this.opened) {
- this.toggleVisibility();
- }
- },
-
- toggleVisibility: function() {
- this.opened = !this.opened;
- this.cancelAnimation();
- this.playAnimation(this.opened ? 'entry' : 'exit');
- },
-
- selectPageNumber: function() {
- this.$.pageselector.select();
- },
-
- shouldKeepOpen: function() {
- return this.$.bookmarks.dropdownOpen || this.loadProgress < 100 ||
- this.$.pageselector.isActive();
- },
-
- hideDropdowns: function() {
- if (this.$.bookmarks.dropdownOpen) {
- this.$.bookmarks.toggleDropdown();
- return true;
- }
- return false;
- },
+ show: function() {
+ if (!this.opened) {
+ this.toggleVisibility();
+ }
+ },
+
+ toggleVisibility: function() {
+ this.opened = !this.opened;
+ this.cancelAnimation();
+ this.playAnimation(this.opened ? 'entry' : 'exit');
+ },
+
+ selectPageNumber: function() {
+ this.$.pageselector.select();
+ },
+
+ shouldKeepOpen: function() {
+ return this.$.bookmarks.dropdownOpen || this.loadProgress < 100 ||
+ this.$.pageselector.isActive();
+ },
+
+ hideDropdowns: function() {
+ if (this.$.bookmarks.dropdownOpen) {
+ this.$.bookmarks.toggleDropdown();
+ return true;
+ }
+ return false;
+ },
- setDropdownLowerBound: function(lowerBound) {
- this.$.bookmarks.lowerBound = lowerBound;
- },
+ setDropdownLowerBound: function(lowerBound) {
+ this.$.bookmarks.lowerBound = lowerBound;
+ },
- rotateRight: function() {
- this.fire('rotate-right');
- },
+ rotateRight: function() {
+ this.fire('rotate-right');
+ },
- download: function() {
- this.fire('save');
- },
+ download: function() {
+ this.fire('save');
+ },
- print: function() {
- this.fire('print');
- }
- });
+ print: function() {
+ this.fire('print');
+ }
+});
})();