OLD | NEW |
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 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 * closing subpages and/or stopping event propagation. | 375 * closing subpages and/or stopping event propagation. |
376 * @return {Event} a mousedown or click event. | 376 * @return {Event} a mousedown or click event. |
377 * @private | 377 * @private |
378 */ | 378 */ |
379 OptionsPage.bodyMouseEventHandler_ = function(event) { | 379 OptionsPage.bodyMouseEventHandler_ = function(event) { |
380 // Do nothing if a subpage isn't showing. | 380 // Do nothing if a subpage isn't showing. |
381 var topPage = this.getTopmostVisiblePage(); | 381 var topPage = this.getTopmostVisiblePage(); |
382 if (!(topPage && topPage.parentPage)) | 382 if (!(topPage && topPage.parentPage)) |
383 return; | 383 return; |
384 | 384 |
| 385 // If an overlay is currently visible, do nothing. |
| 386 if (this.isOverlayVisible_()) |
| 387 return; |
| 388 |
385 // If the click was within a subpage, do nothing. | 389 // If the click was within a subpage, do nothing. |
386 for (var level = 1; level <= 2; level++) { | 390 for (var level = 1; level <= 2; level++) { |
387 if ($('subpage-sheet-container-' + level).contains(event.target)) | 391 if ($('subpage-sheet-container-' + level).contains(event.target)) |
388 return; | 392 return; |
389 } | 393 } |
390 | 394 |
391 // Close all subpages on click. | 395 // Close all subpages on click. |
392 if (event.type == 'click') | 396 if (event.type == 'click') |
393 this.closeSubPagesToLevel(0); | 397 this.closeSubPagesToLevel(0); |
394 | 398 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 OptionsPage.showOverlay(hash); | 574 OptionsPage.showOverlay(hash); |
571 }, | 575 }, |
572 }; | 576 }; |
573 | 577 |
574 // Export | 578 // Export |
575 return { | 579 return { |
576 OptionsPage: OptionsPage | 580 OptionsPage: OptionsPage |
577 }; | 581 }; |
578 | 582 |
579 }); | 583 }); |
OLD | NEW |