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 cr.define('ntp4', function() { | 5 cr.define('ntp4', 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 (e.propertyName == 'left' || e.propertyName == 'top' || | 258 (e.propertyName == 'left' || e.propertyName == 'top' || |
259 e.propertyName == '-webkit-transform')) { | 259 e.propertyName == '-webkit-transform')) { |
260 this.finalizeDrag_(); | 260 this.finalizeDrag_(); |
261 } | 261 } |
262 }, | 262 }, |
263 | 263 |
264 /** | 264 /** |
265 * Called when an app is removed from Chrome. Animates its disappearance. | 265 * Called when an app is removed from Chrome. Animates its disappearance. |
266 */ | 266 */ |
267 doRemove: function() { | 267 doRemove: function() { |
268 var contents = this.firstChild; | |
269 this.firstChild.classList.add('removing-tile-contents'); | 268 this.firstChild.classList.add('removing-tile-contents'); |
270 }, | 269 }, |
271 | 270 |
272 /** | 271 /** |
273 * Callback for the webkitAnimationEnd event on the tile's contents. | 272 * Callback for the webkitAnimationEnd event on the tile's contents. |
274 * @param {Event} e The event object. | 273 * @param {Event} e The event object. |
275 */ | 274 */ |
276 onContentsAnimationEnd_: function(e) { | 275 onContentsAnimationEnd_: function(e) { |
277 if (this.firstChild.classList.contains('new-tile-contents')) | 276 if (this.firstChild.classList.contains('new-tile-contents')) |
278 this.firstChild.classList.remove('new-tile-contents'); | 277 this.firstChild.classList.remove('new-tile-contents'); |
279 else if (this.firstChild.classList.contains('removing-tile-contents')) | 278 if (this.firstChild.classList.contains('removing-tile-contents')) |
280 this.tilePage.removeTile(this); | 279 this.tilePage.removeTile(this); |
281 }, | 280 }, |
282 }; | 281 }; |
283 | 282 |
284 /** | 283 /** |
285 * Gives the proportion of the row width that is devoted to a single icon. | 284 * Gives the proportion of the row width that is devoted to a single icon. |
286 * @param {number} rowTileCount The number of tiles in a row. | 285 * @param {number} rowTileCount The number of tiles in a row. |
287 * @return {number} The ratio between icon width and row width. | 286 * @return {number} The ratio between icon width and row width. |
288 */ | 287 */ |
289 function tileWidthFraction(rowTileCount) { | 288 function tileWidthFraction(rowTileCount) { |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 setDropEffect: function(dataTransfer) { | 1034 setDropEffect: function(dataTransfer) { |
1036 assert(false); | 1035 assert(false); |
1037 }, | 1036 }, |
1038 }; | 1037 }; |
1039 | 1038 |
1040 return { | 1039 return { |
1041 getCurrentlyDraggingTile: getCurrentlyDraggingTile, | 1040 getCurrentlyDraggingTile: getCurrentlyDraggingTile, |
1042 TilePage: TilePage, | 1041 TilePage: TilePage, |
1043 }; | 1042 }; |
1044 }); | 1043 }); |
OLD | NEW |