| 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 PageListView implementation. | 6 * @fileoverview PageListView implementation. |
| 7 * PageListView manages page list, dot list, switcher buttons and handles apps | 7 * PageListView manages page list, dot list, switcher buttons and handles apps |
| 8 * pages callbacks from backend. | 8 * pages callbacks from backend. |
| 9 * | 9 * |
| 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. | 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 if (this.cardSlider.currentCard >= tempIndex) | 432 if (this.cardSlider.currentCard >= tempIndex) |
| 433 this.cardSlider.currentCard += 1; | 433 this.cardSlider.currentCard += 1; |
| 434 this.updateSliderCards(); | 434 this.updateSliderCards(); |
| 435 | 435 |
| 436 if (ntp4.getCurrentlyDraggingTile().firstChild.canBeRemoved()) | 436 if (ntp4.getCurrentlyDraggingTile().firstChild.canBeRemoved()) |
| 437 $('footer').classList.add('showing-trash-mode'); | 437 $('footer').classList.add('showing-trash-mode'); |
| 438 }, | 438 }, |
| 439 | 439 |
| 440 /** | 440 /** |
| 441 * Invoked whenever some app is released | 441 * Invoked whenever some app is released |
| 442 * @param {cr.ui.Grabber.Event} e The Grabber RELEASE event. | |
| 443 */ | 442 */ |
| 444 leaveRearrangeMode: function(e) { | 443 leaveRearrangeMode: function() { |
| 445 var tempPage = document.querySelector('.tile-page.temporary'); | 444 var tempPage = document.querySelector('.tile-page.temporary'); |
| 446 var dot = tempPage.navigationDot; | 445 var dot = tempPage.navigationDot; |
| 447 if (!tempPage.tileCount && tempPage != this.cardSlider.currentCardValue) { | 446 if (!tempPage.tileCount && tempPage != this.cardSlider.currentCardValue) { |
| 448 dot.animateRemove(); | 447 dot.animateRemove(); |
| 449 var tempIndex = Array.prototype.indexOf.call(this.tilePages, tempPage); | 448 var tempIndex = Array.prototype.indexOf.call(this.tilePages, tempPage); |
| 450 if (this.cardSlider.currentCard > tempIndex) | 449 if (this.cardSlider.currentCard > tempIndex) |
| 451 this.cardSlider.currentCard -= 1; | 450 this.cardSlider.currentCard -= 1; |
| 452 tempPage.parentNode.removeChild(tempPage); | 451 tempPage.parentNode.removeChild(tempPage); |
| 453 this.updateSliderCards(); | 452 this.updateSliderCards(); |
| 454 } else { | 453 } else { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 this.cardSlider.selectCard(cardIndex, true); | 612 this.cardSlider.selectCard(cardIndex, true); |
| 614 | 613 |
| 615 e.stopPropagation(); | 614 e.stopPropagation(); |
| 616 } | 615 } |
| 617 }; | 616 }; |
| 618 | 617 |
| 619 return { | 618 return { |
| 620 PageListView: PageListView | 619 PageListView: PageListView |
| 621 }; | 620 }; |
| 622 }); | 621 }); |
| OLD | NEW |