OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 /** | 5 /** |
6 * @fileoverview Nav dot | 6 * @fileoverview Nav dot |
7 * This is the class for the navigation controls that appear along the bottom | 7 * This is the class for the navigation controls that appear along the bottom |
8 * of the NTP. | 8 * of the NTP. |
9 */ | 9 */ |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 * @type {String} title The display name for this nav dot. | 85 * @type {String} title The display name for this nav dot. |
86 */ | 86 */ |
87 get displayTitle() { | 87 get displayTitle() { |
88 return this.title; | 88 return this.title; |
89 }, | 89 }, |
90 set displayTitle(title) { | 90 set displayTitle(title) { |
91 this.title = this.input_.value = title; | 91 this.title = this.input_.value = title; |
92 }, | 92 }, |
93 | 93 |
94 /** | 94 /** |
95 * Removes the dot from the page after transitioning to 0 width. | 95 * Removes the dot from the page. If |opt_animate| is truthy, we first |
| 96 * transition the element to 0 width. |
| 97 * @param {boolean=} opt_animate Whether to animate the removal or not. |
96 */ | 98 */ |
97 animateRemove: function() { | 99 remove: function(opt_animate) { |
98 this.classList.add('small'); | 100 if (opt_animate) |
| 101 this.classList.add('small'); |
| 102 else |
| 103 this.parentNode.removeChild(this); |
99 }, | 104 }, |
100 | 105 |
101 /** | 106 /** |
102 * Navigates the card slider to the page for this dot. | 107 * Navigates the card slider to the page for this dot. |
103 */ | 108 */ |
104 switchToPage: function() { | 109 switchToPage: function() { |
105 ntp4.getCardSlider().selectCardByValue(this.page_, true); | 110 ntp4.getCardSlider().selectCardByValue(this.page_, true); |
106 }, | 111 }, |
107 | 112 |
108 /** | 113 /** |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 onTransitionEnd_: function(e) { | 268 onTransitionEnd_: function(e) { |
264 if (e.propertyName === 'max-width' && this.classList.contains('small')) | 269 if (e.propertyName === 'max-width' && this.classList.contains('small')) |
265 this.parentNode.removeChild(this); | 270 this.parentNode.removeChild(this); |
266 }, | 271 }, |
267 }; | 272 }; |
268 | 273 |
269 return { | 274 return { |
270 NavDot: NavDot, | 275 NavDot: NavDot, |
271 }; | 276 }; |
272 }); | 277 }); |
OLD | NEW |