OLD | NEW |
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 ///////////////////////////////////////////////////////////////////////////// | 6 ///////////////////////////////////////////////////////////////////////////// |
7 // OptionsPage class: | 7 // OptionsPage class: |
8 | 8 |
9 /** | 9 /** |
10 * Base class for options page. | 10 * Base class for options page. |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 * @private | 772 * @private |
773 */ | 773 */ |
774 setOverlayVisible_: function(visible) { | 774 setOverlayVisible_: function(visible) { |
775 assert(this.isOverlay); | 775 assert(this.isOverlay); |
776 var pageDiv = this.pageDiv; | 776 var pageDiv = this.pageDiv; |
777 var container = this.container; | 777 var container = this.container; |
778 | 778 |
779 if (visible) { | 779 if (visible) { |
780 uber.invokeMethodOnParent('beginInterceptingEvents'); | 780 uber.invokeMethodOnParent('beginInterceptingEvents'); |
781 this.pageDiv.removeAttribute('aria-hidden'); | 781 this.pageDiv.removeAttribute('aria-hidden'); |
782 this.parentPage.pageDiv.setAttribute('aria-hidden', true); | 782 if (this.parentPage) |
| 783 this.parentPage.pageDiv.setAttribute('aria-hidden', true); |
783 } else { | 784 } else { |
784 this.parentPage.pageDiv.removeAttribute('aria-hidden'); | 785 if (this.parentPage) |
| 786 this.parentPage.pageDiv.removeAttribute('aria-hidden'); |
785 } | 787 } |
786 | 788 |
787 if (container.hidden != visible) { | 789 if (container.hidden != visible) { |
788 if (visible) { | 790 if (visible) { |
789 // If the container is set hidden and then immediately set visible | 791 // If the container is set hidden and then immediately set visible |
790 // again, the fadeCompleted_ callback would cause it to be erroneously | 792 // again, the fadeCompleted_ callback would cause it to be erroneously |
791 // hidden again. Removing the transparent tag avoids that. | 793 // hidden again. Removing the transparent tag avoids that. |
792 container.classList.remove('transparent'); | 794 container.classList.remove('transparent'); |
793 | 795 |
794 // Hide all dialogs in this container since a different one may have | 796 // Hide all dialogs in this container since a different one may have |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 canShowPage: function() { | 899 canShowPage: function() { |
898 return true; | 900 return true; |
899 }, | 901 }, |
900 }; | 902 }; |
901 | 903 |
902 // Export | 904 // Export |
903 return { | 905 return { |
904 OptionsPage: OptionsPage | 906 OptionsPage: OptionsPage |
905 }; | 907 }; |
906 }); | 908 }); |
OLD | NEW |