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 /** 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 Loading... |
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 })(); |
OLD | NEW |