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

Side by Side Diff: chrome/browser/resources/options2/inline_editable_list.js

Issue 9665012: Possible JavaScript errors caught by the closure compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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) 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('options', function() { 5 cr.define('options', function() {
6 const DeletableItem = options.DeletableItem; 6 const DeletableItem = options.DeletableItem;
7 const DeletableItemList = options.DeletableItemList; 7 const DeletableItemList = options.DeletableItemList;
8 8
9 /** 9 /**
10 * Creates a new list item with support for inline editing. 10 * Creates a new list item with support for inline editing.
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 349
350 /** 350 /**
351 * Takes care of committing changes to inline editable list items when the 351 * Takes care of committing changes to inline editable list items when the
352 * window loses focus. 352 * window loses focus.
353 */ 353 */
354 function handleWindowBlurs() { 354 function handleWindowBlurs() {
355 window.addEventListener('blur', function(e) { 355 window.addEventListener('blur', function(e) {
356 var itemAncestor = findAncestor(document.activeElement, function(node) { 356 var itemAncestor = findAncestor(document.activeElement, function(node) {
357 return node instanceof InlineEditableItem; 357 return node instanceof InlineEditableItem;
358 }); 358 });
359 if (itemAncestor); 359 if (itemAncestor)
Tyler Breisacher (Chromium) 2012/03/09 22:36:17 This one should be safe too, unless we're somehow
360 document.activeElement.blur(); 360 document.activeElement.blur();
361 }); 361 });
362 } 362 }
363 handleWindowBlurs(); 363 handleWindowBlurs();
364 364
365 var InlineEditableItemList = cr.ui.define('list'); 365 var InlineEditableItemList = cr.ui.define('list');
366 366
367 InlineEditableItemList.prototype = { 367 InlineEditableItemList.prototype = {
368 __proto__: DeletableItemList.prototype, 368 __proto__: DeletableItemList.prototype,
369 369
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 return true; 406 return true;
407 }, 407 },
408 }; 408 };
409 409
410 // Export 410 // Export
411 return { 411 return {
412 InlineEditableItem: InlineEditableItem, 412 InlineEditableItem: InlineEditableItem,
413 InlineEditableItemList: InlineEditableItemList, 413 InlineEditableItemList: InlineEditableItemList,
414 }; 414 };
415 }); 415 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698