Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/resources/pdf/elements/viewer-bookmark/viewer-bookmark.js

Issue 1364163002: Material PDF: Support RTL languages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use reflectToAttribute Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /** Amount that each level of bookmarks is indented by (px). */ 6 /** Amount that each level of bookmarks is indented by (px). */
7 var BOOKMARK_INDENT = 20; 7 var BOOKMARK_INDENT = 20;
8 8
9 Polymer({ 9 Polymer({
10 is: 'viewer-bookmark', 10 is: 'viewer-bookmark',
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 }, 35 },
36 36
37 bookmarkChanged_: function() { 37 bookmarkChanged_: function() {
38 this.$.expand.style.visibility = 38 this.$.expand.style.visibility =
39 this.bookmark.children.length > 0 ? 'visible' : 'hidden'; 39 this.bookmark.children.length > 0 ? 'visible' : 'hidden';
40 }, 40 },
41 41
42 depthChanged: function() { 42 depthChanged: function() {
43 this.childDepth = this.depth + 1; 43 this.childDepth = this.depth + 1;
44 this.$.item.style.paddingLeft = (this.depth * BOOKMARK_INDENT) + 'px'; 44 this.$.item.style.webkitPaddingStart =
45 (this.depth * BOOKMARK_INDENT) + 'px';
45 }, 46 },
46 47
47 onClick: function() { 48 onClick: function() {
48 if (this.bookmark.hasOwnProperty('page')) 49 if (this.bookmark.hasOwnProperty('page'))
49 this.fire('change-page', {page: this.bookmark.page}); 50 this.fire('change-page', {page: this.bookmark.page});
50 }, 51 },
51 52
52 toggleChildren: function(e) { 53 toggleChildren: function(e) {
53 this.childrenShown_ = !this.childrenShown_; 54 this.childrenShown_ = !this.childrenShown_;
54 if (this.childrenShown_) 55 if (this.childrenShown_)
55 this.$.expand.classList.add('open'); 56 this.$.expand.classList.add('open');
56 else 57 else
57 this.$.expand.classList.remove('open'); 58 this.$.expand.classList.remove('open');
58 e.stopPropagation(); // Prevent the above onClick handler from firing. 59 e.stopPropagation(); // Prevent the above onClick handler from firing.
59 } 60 }
60 }); 61 });
61 })(); 62 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698