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

Side by Side Diff: chrome/browser/resources/ntp/most_visited.js

Issue 3346006: NTP: Add transitions. (Closed)
Patch Set: formatting Created 10 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
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('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 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // Dependencies that we should remove/formalize: 5 // Dependencies that we should remove/formalize:
6 // ../shared/js/class_list.js 6 // ../shared/js/class_list.js
7 // util.js 7 // util.js
8 // 8 //
9 // afterTransition 9 // afterTransition
10 // chrome.send 10 // chrome.send
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 a.textContent = item.title; 572 a.textContent = item.title;
573 a.style.backgroundImage = url('chrome://favicon/' + item.url); 573 a.style.backgroundImage = url('chrome://favicon/' + item.url);
574 a.className = 'item'; 574 a.className = 'item';
575 this.miniview.appendChild(span); 575 this.miniview.appendChild(span);
576 576
577 if ((a.offsetLeft + a.offsetWidth) > this.miniview.offsetWidth) { 577 if ((a.offsetLeft + a.offsetWidth) > this.miniview.offsetWidth) {
578 this.miniview.removeChild(span); 578 this.miniview.removeChild(span);
579 return; 579 return;
580 } 580 }
581 } 581 }
582 updateMiniviewClipping(this.miniview);
582 }, 583 },
583 584
584 handleClick_: function(e) { 585 handleClick_: function(e) {
585 var target = e.target; 586 var target = e.target;
586 if (target.classList.contains('pin')) { 587 if (target.classList.contains('pin')) {
587 this.togglePinned_(getItem(target)); 588 this.togglePinned_(getItem(target));
588 e.preventDefault(); 589 e.preventDefault();
589 } else if (target.classList.contains('remove')) { 590 } else if (target.classList.contains('remove')) {
590 this.blacklist(getItem(target)); 591 this.blacklist(getItem(target));
591 e.preventDefault(); 592 e.preventDefault();
(...skipping 14 matching lines...) Expand all
606 handleKeyDown_: function(e) { 607 handleKeyDown_: function(e) {
607 if (!IS_MAC && e.keyCode == 46 || // Del 608 if (!IS_MAC && e.keyCode == 46 || // Del
608 IS_MAC && e.metaKey && e.keyCode == 8) { // Cmd + Backspace 609 IS_MAC && e.metaKey && e.keyCode == 8) { // Cmd + Backspace
609 this.blacklist(e.target); 610 this.blacklist(e.target);
610 } 611 }
611 } 612 }
612 }; 613 };
613 614
614 return MostVisited; 615 return MostVisited;
615 })(); 616 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698