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

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

Issue 9320051: Fix JavaScript style in ntp4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 10 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/ntp4/page_switcher.js ('k') | chrome/browser/resources/ntp4/trash.js » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // We can't pass the currently dragging tile via dataTransfer because of 8 // We can't pass the currently dragging tile via dataTransfer because of
9 // http://crbug.com/31037 9 // http://crbug.com/31037
10 var currentlyDraggingTile = null; 10 var currentlyDraggingTile = null;
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 this.focusElementIndex_ = wrap(this.focusElementIndex_ + direction); 699 this.focusElementIndex_ = wrap(this.focusElementIndex_ + direction);
700 break; 700 break;
701 case 'Up': 701 case 'Up':
702 case 'Down': 702 case 'Down':
703 // Look through all focusable elements. Find the first one that is 703 // Look through all focusable elements. Find the first one that is
704 // in the same column. 704 // in the same column.
705 var direction = e.keyIdentifier == 'Up' ? -1 : 1; 705 var direction = e.keyIdentifier == 'Up' ? -1 : 1;
706 var currentIndex = 706 var currentIndex =
707 Array.prototype.indexOf.call(this.focusableElements_, 707 Array.prototype.indexOf.call(this.focusableElements_,
708 this.currentFocusElement_); 708 this.currentFocusElement_);
709 var newFocusIdx = wrap(currentIndex + direction) 709 var newFocusIdx = wrap(currentIndex + direction);
710 var tile = this.currentFocusElement_.parentNode; 710 var tile = this.currentFocusElement_.parentNode;
711 for (;; newFocusIdx = wrap(newFocusIdx + direction)) { 711 for (;; newFocusIdx = wrap(newFocusIdx + direction)) {
712 var newTile = this.focusableElements_[newFocusIdx].parentNode; 712 var newTile = this.focusableElements_[newFocusIdx].parentNode;
713 var rowTiles = this.layoutValues_.numRowTiles; 713 var rowTiles = this.layoutValues_.numRowTiles;
714 if ((newTile.index - tile.index) % rowTiles == 0) 714 if ((newTile.index - tile.index) % rowTiles == 0)
715 break; 715 break;
716 } 716 }
717 717
718 this.focusElementIndex_ = newFocusIdx; 718 this.focusElementIndex_ = newFocusIdx;
719 break; 719 break;
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 assert(false); 1289 assert(false);
1290 }, 1290 },
1291 }; 1291 };
1292 1292
1293 return { 1293 return {
1294 getCurrentlyDraggingTile: getCurrentlyDraggingTile, 1294 getCurrentlyDraggingTile: getCurrentlyDraggingTile,
1295 setCurrentDropEffect: setCurrentDropEffect, 1295 setCurrentDropEffect: setCurrentDropEffect,
1296 TilePage: TilePage, 1296 TilePage: TilePage,
1297 }; 1297 };
1298 }); 1298 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/page_switcher.js ('k') | chrome/browser/resources/ntp4/trash.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698