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

Side by Side Diff: chrome/browser/resources/ntp4/nav_dot.js

Issue 9116037: [NTP4] Make TilePage and CardSlider evented to simplify code and fix page switcher bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: found one more bug when you leave a tab while mousing over page switcher Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/resources/ntp4/page_list_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698