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

Side by Side Diff: chrome/browser/resources/new_new_tab.js

Issue 155542: NNTP: Lots of small tweaks... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Helpers 2 // Helpers
3 3
4 function $(id) { 4 function $(id) {
5 return document.getElementById(id); 5 return document.getElementById(id);
6 } 6 }
7 7
8 // TODO(arv): Remove these when classList is available in HTML5. 8 // TODO(arv): Remove these when classList is available in HTML5.
9 // https://bugs.webkit.org/show_bug.cgi?id=20709 9 // https://bugs.webkit.org/show_bug.cgi?id=20709
10 function hasClass(el, name) { 10 function hasClass(el, name) {
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 } 1110 }
1111 1111
1112 this.currentOverItem = null; 1112 this.currentOverItem = null;
1113 }, 1113 },
1114 1114
1115 handleDrop: function(e) { 1115 handleDrop: function(e) {
1116 var dropTarget = mostVisited.getItem(e.target); 1116 var dropTarget = mostVisited.getItem(e.target);
1117 if (this.canDropOnElement(dropTarget)) { 1117 if (this.canDropOnElement(dropTarget)) {
1118 dropTarget.style.zIndex = 1; 1118 dropTarget.style.zIndex = 1;
1119 mostVisited.swapPosition(this.dragItem, dropTarget); 1119 mostVisited.swapPosition(this.dragItem, dropTarget);
1120 mostVisited.invalidate(); 1120 // The timeout below is to allow WebKit to see that we turned off
1121 mostVisited.layout(); 1121 // pointer-event before moving the thumbnails so that we can get out of
1122 // hover mode.
1123 window.setTimeout(function() {
1124 mostVisited.invalidate();
1125 mostVisited.layout();
1126 }, 10);
1122 e.preventDefault(); 1127 e.preventDefault();
1123 if (this.dragEndTimer) { 1128 if (this.dragEndTimer) {
1124 window.clearTimeout(this.dragEndTimer); 1129 window.clearTimeout(this.dragEndTimer);
1125 this.dragEndTimer = null; 1130 this.dragEndTimer = null;
1126 } 1131 }
1127 afterTransition(function() { 1132 afterTransition(function() {
1128 dropTarget.style.zIndex = ''; 1133 dropTarget.style.zIndex = '';
1129 }); 1134 });
1130 } 1135 }
1131 }, 1136 },
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 el.addEventListener('dragover', bind(this.handleDragOver, this)); 1191 el.addEventListener('dragover', bind(this.handleDragOver, this));
1187 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); 1192 el.addEventListener('dragleave', bind(this.handleDragLeave, this));
1188 el.addEventListener('drop', bind(this.handleDrop, this)); 1193 el.addEventListener('drop', bind(this.handleDrop, this));
1189 el.addEventListener('dragend', bind(this.handleDragEnd, this)); 1194 el.addEventListener('dragend', bind(this.handleDragEnd, this));
1190 el.addEventListener('drag', bind(this.handleDrag, this)); 1195 el.addEventListener('drag', bind(this.handleDrag, this));
1191 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); 1196 el.addEventListener('mousedown', bind(this.handleMouseDown, this));
1192 } 1197 }
1193 }; 1198 };
1194 1199
1195 dnd.init(); 1200 dnd.init();
OLDNEW
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698