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

Side by Side Diff: chrome/browser/resources/options/options_page.js

Issue 6375006: dom-ui settings: Don't allow click sub-page closing when an overlay is visibl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « no previous file | no next file » | 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) 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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698