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 var localStrings = new LocalStrings; | 8 var localStrings = new LocalStrings; |
9 | 9 |
10 var APP_LAUNCH = { | 10 var APP_LAUNCH = { |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
635 /** @inheritDoc */ | 635 /** @inheritDoc */ |
636 addDragData: function(dataTransfer, index) { | 636 addDragData: function(dataTransfer, index) { |
637 var currentlyDraggingTile = ntp4.getCurrentlyDraggingTile(); | 637 var currentlyDraggingTile = ntp4.getCurrentlyDraggingTile(); |
638 if (currentlyDraggingTile) { | 638 if (currentlyDraggingTile) { |
639 var tileContents = currentlyDraggingTile.firstChild; | 639 var tileContents = currentlyDraggingTile.firstChild; |
640 if (tileContents.classList.contains('app')) { | 640 if (tileContents.classList.contains('app')) { |
641 this.tileGrid_.insertBefore( | 641 this.tileGrid_.insertBefore( |
642 currentlyDraggingTile, | 642 currentlyDraggingTile, |
643 this.tileElements_[index]); | 643 this.tileElements_[index]); |
644 this.tileMoved(currentlyDraggingTile); | 644 this.tileMoved(currentlyDraggingTile); |
645 } else if (currentlyDraggingTile.querySelector('.most-visited')) { | 645 } else if (currentlyDraggingTile.querySelector('.most-visited') || |
646 currentlyDraggingTile.querySelector('.bookmark')) { | |
Dan Beam
2011/09/22 22:36:01
like we talked about on chat, might as well add a
| |
646 this.generateAppForLink(tileContents.data); | 647 this.generateAppForLink(tileContents.data); |
647 } | 648 } |
648 } else { | 649 } else { |
649 this.addOutsideData_(dataTransfer, index); | 650 this.addOutsideData_(dataTransfer, index); |
650 } | 651 } |
651 }, | 652 }, |
652 | 653 |
653 /** | 654 /** |
654 * Adds drag data that has been dropped from a source that is not a tile. | 655 * Adds drag data that has been dropped from a source that is not a tile. |
655 * @param {Object} dataTransfer The data transfer object that holds drop | 656 * @param {Object} dataTransfer The data transfer object that holds drop |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
749 appNotificationChanged: appNotificationChanged, | 750 appNotificationChanged: appNotificationChanged, |
750 AppsPage: AppsPage, | 751 AppsPage: AppsPage, |
751 launchAppAfterEnable: launchAppAfterEnable, | 752 launchAppAfterEnable: launchAppAfterEnable, |
752 }; | 753 }; |
753 }); | 754 }); |
754 | 755 |
755 // TODO(estade): update the content handlers to use ntp namespace instead of | 756 // TODO(estade): update the content handlers to use ntp namespace instead of |
756 // making these global. | 757 // making these global. |
757 var appNotificationChanged = ntp4.appNotificationChanged; | 758 var appNotificationChanged = ntp4.appNotificationChanged; |
758 var launchAppAfterEnable = ntp4.launchAppAfterEnable; | 759 var launchAppAfterEnable = ntp4.launchAppAfterEnable; |
OLD | NEW |