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

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

Issue 7951011: Moving where I'm doing dropEffect normalization. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: incorporating csilv's review Created 9 years, 3 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 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 /** 10 /**
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 499
500 /** @inheritDoc */ 500 /** @inheritDoc */
501 get extraBottomPadding() { 501 get extraBottomPadding() {
502 return 40; 502 return 40;
503 }, 503 },
504 504
505 /** @inheritDoc */ 505 /** @inheritDoc */
506 setDropEffect: function(dataTransfer) { 506 setDropEffect: function(dataTransfer) {
507 var tile = ntp4.getCurrentlyDraggingTile(); 507 var tile = ntp4.getCurrentlyDraggingTile();
508 if (tile && tile.querySelector('.bookmark')) 508 if (tile && tile.querySelector('.bookmark'))
509 dataTransfer.dropEffect = 'move'; 509 ntp4.setCurrentDropEffect(dataTransfer, 'move');
510 else 510 else
511 dataTransfer.dropEffect = 'copy'; 511 ntp4.setCurrentDropEffect(dataTransfer, 'copy');
512 }, 512 },
513 513
514 /** @inheritDoc */ 514 /** @inheritDoc */
515 addDragData: function(dataTransfer, index) { 515 addDragData: function(dataTransfer, index) {
516 var parentId = ROOT_NODE_ID == this.id ? BOOKMARKS_BAR_ID : this.id; 516 var parentId = ROOT_NODE_ID == this.id ? BOOKMARKS_BAR_ID : this.id;
517 var currentlyDraggingTile = ntp4.getCurrentlyDraggingTile(); 517 var currentlyDraggingTile = ntp4.getCurrentlyDraggingTile();
518 if (currentlyDraggingTile) { 518 if (currentlyDraggingTile) {
519 var tileContents = currentlyDraggingTile.firstChild; 519 var tileContents = currentlyDraggingTile.firstChild;
520 if (tileContents.classList.contains('most-visited')) { 520 if (tileContents.classList.contains('most-visited')) {
521 this.generateBookmarkForLink(parentId, index, 521 this.generateBookmarkForLink(parentId, index,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 tile.stripeColor = color; 633 tile.stripeColor = color;
634 } 634 }
635 635
636 return { 636 return {
637 BookmarksPage: BookmarksPage, 637 BookmarksPage: BookmarksPage,
638 initBookmarkChevron: initBookmarkChevron, 638 initBookmarkChevron: initBookmarkChevron,
639 }; 639 };
640 }); 640 });
641 641
642 window.addEventListener('load', ntp4.initBookmarkChevron); 642 window.addEventListener('load', ntp4.initBookmarkChevron);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698