OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('ntp', function() { | 5 cr.define('ntp', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 // We can't pass the currently dragging tile via dataTransfer because of | 8 // We can't pass the currently dragging tile via dataTransfer because of |
9 // http://crbug.com/31037 | 9 // http://crbug.com/31037 |
10 var currentlyDraggingTile = null; | 10 var currentlyDraggingTile = null; |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 }, | 291 }, |
292 | 292 |
293 /** | 293 /** |
294 * Called when an app is removed from Chrome. Animates its disappearance. | 294 * Called when an app is removed from Chrome. Animates its disappearance. |
295 * @param {boolean=} opt_animate Whether the animation should be animated. | 295 * @param {boolean=} opt_animate Whether the animation should be animated. |
296 */ | 296 */ |
297 doRemove: function(opt_animate) { | 297 doRemove: function(opt_animate) { |
298 if (opt_animate) | 298 if (opt_animate) |
299 this.firstChild.classList.add('removing-tile-contents'); | 299 this.firstChild.classList.add('removing-tile-contents'); |
300 else | 300 else |
301 this.parentNode.removeChild(this); | 301 this.tilePage.removeTile(this, false); |
302 }, | 302 }, |
303 | 303 |
304 /** | 304 /** |
305 * Callback for the webkitAnimationEnd event on the tile's contents. | 305 * Callback for the webkitAnimationEnd event on the tile's contents. |
306 * @param {Event} e The event object. | 306 * @param {Event} e The event object. |
307 */ | 307 */ |
308 onContentsAnimationEnd_: function(e) { | 308 onContentsAnimationEnd_: function(e) { |
309 if (this.firstChild.classList.contains('new-tile-contents')) | 309 if (this.firstChild.classList.contains('new-tile-contents')) |
310 this.firstChild.classList.remove('new-tile-contents'); | 310 this.firstChild.classList.remove('new-tile-contents'); |
311 if (this.firstChild.classList.contains('removing-tile-contents')) | 311 if (this.firstChild.classList.contains('removing-tile-contents')) |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 assert(false); | 1320 assert(false); |
1321 }, | 1321 }, |
1322 }; | 1322 }; |
1323 | 1323 |
1324 return { | 1324 return { |
1325 getCurrentlyDraggingTile: getCurrentlyDraggingTile, | 1325 getCurrentlyDraggingTile: getCurrentlyDraggingTile, |
1326 setCurrentDropEffect: setCurrentDropEffect, | 1326 setCurrentDropEffect: setCurrentDropEffect, |
1327 TilePage: TilePage, | 1327 TilePage: TilePage, |
1328 }; | 1328 }; |
1329 }); | 1329 }); |
OLD | NEW |