OLD | NEW |
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('options.contentSettings', function() { | 5 cr.define('options.contentSettings', function() { |
6 const InlineEditableItemList = options.InlineEditableItemList; | 6 const InlineEditableItemList = options.InlineEditableItemList; |
7 const InlineEditableItem = options.InlineEditableItem; | 7 const InlineEditableItem = options.InlineEditableItem; |
8 const ArrayDataModel = cr.ui.ArrayDataModel; | 8 const ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 * Shows one list and hides all others. | 498 * Shows one list and hides all others. |
499 * @param {string} type The content type. | 499 * @param {string} type The content type. |
500 */ | 500 */ |
501 showList: function(type) { | 501 showList: function(type) { |
502 var header = this.pageDiv.querySelector('h1'); | 502 var header = this.pageDiv.querySelector('h1'); |
503 header.textContent = templateData[type + '_header']; | 503 header.textContent = templateData[type + '_header']; |
504 | 504 |
505 var divs = this.pageDiv.querySelectorAll('div[contentType]'); | 505 var divs = this.pageDiv.querySelectorAll('div[contentType]'); |
506 for (var i = 0; i < divs.length; i++) { | 506 for (var i = 0; i < divs.length; i++) { |
507 if (divs[i].getAttribute('contentType') == type) | 507 if (divs[i].getAttribute('contentType') == type) |
508 divs[i].classList.remove('hidden'); | 508 divs[i].hidden = false; |
509 else | 509 else |
510 divs[i].classList.add('hidden'); | 510 divs[i].hidden = true; |
511 } | 511 } |
512 }, | 512 }, |
513 | 513 |
514 /** | 514 /** |
515 * Called after the page has been shown. Show the content type for the | 515 * Called after the page has been shown. Show the content type for the |
516 * location's hash. | 516 * location's hash. |
517 */ | 517 */ |
518 didShowPage: function() { | 518 didShowPage: function() { |
519 var hash = location.hash; | 519 var hash = location.hash; |
520 if (hash) | 520 if (hash) |
521 this.showList(hash.slice(1)); | 521 this.showList(hash.slice(1)); |
522 }, | 522 }, |
523 }; | 523 }; |
524 | 524 |
525 /** | 525 /** |
526 * Called when the last incognito window is closed. | 526 * Called when the last incognito window is closed. |
527 */ | 527 */ |
528 ContentSettingsExceptionsArea.OTRProfileDestroyed = function() { | 528 ContentSettingsExceptionsArea.OTRProfileDestroyed = function() { |
529 this.hideOTRLists(); | 529 this.hideOTRLists(); |
530 }; | 530 }; |
531 | 531 |
532 /** | 532 /** |
533 * Clears and hides the incognito exceptions lists. | 533 * Clears and hides the incognito exceptions lists. |
534 */ | 534 */ |
535 ContentSettingsExceptionsArea.hideOTRLists = function() { | 535 ContentSettingsExceptionsArea.hideOTRLists = function() { |
536 var otrLists = document.querySelectorAll('list[mode=otr]'); | 536 var otrLists = document.querySelectorAll('list[mode=otr]'); |
537 | 537 |
538 for (var i = 0; i < otrLists.length; i++) { | 538 for (var i = 0; i < otrLists.length; i++) { |
539 otrLists[i].reset(); | 539 otrLists[i].reset(); |
540 otrLists[i].parentNode.classList.add('hidden'); | 540 otrLists[i].parentNode.hidden = true; |
541 } | 541 } |
542 }; | 542 }; |
543 | 543 |
544 return { | 544 return { |
545 ExceptionsListItem: ExceptionsListItem, | 545 ExceptionsListItem: ExceptionsListItem, |
546 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 546 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
547 ExceptionsList: ExceptionsList, | 547 ExceptionsList: ExceptionsList, |
548 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 548 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
549 }; | 549 }; |
550 }); | 550 }); |
OLD | NEW |