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

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: Rebase 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 24 matching lines...) Expand all
35 } 35 }
36 }, 36 },
37 37
38 bookmarkChanged_: function() { 38 bookmarkChanged_: function() {
39 this.$.expand.style.visibility = 39 this.$.expand.style.visibility =
40 this.bookmark.children.length > 0 ? 'visible' : 'hidden'; 40 this.bookmark.children.length > 0 ? 'visible' : 'hidden';
41 }, 41 },
42 42
43 depthChanged: function() { 43 depthChanged: function() {
44 this.childDepth = this.depth + 1; 44 this.childDepth = this.depth + 1;
45 this.$.item.style.paddingLeft = (this.depth * BOOKMARK_INDENT) + 'px'; 45 this.$.item.style.webkitPaddingStart =
46 (this.depth * BOOKMARK_INDENT) + 'px';
46 }, 47 },
47 48
48 onClick: function() { 49 onClick: function() {
49 if (this.bookmark.hasOwnProperty('page')) 50 if (this.bookmark.hasOwnProperty('page'))
50 this.fire('change-page', {page: this.bookmark.page}); 51 this.fire('change-page', {page: this.bookmark.page});
51 }, 52 },
52 53
53 toggleChildren: function(e) { 54 toggleChildren: function(e) {
54 this.childrenShown = !this.childrenShown; 55 this.childrenShown = !this.childrenShown;
55 e.stopPropagation(); // Prevent the above onClick handler from firing. 56 e.stopPropagation(); // Prevent the above onClick handler from firing.
56 } 57 }
57 }); 58 });
58 })(); 59 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698