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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 * @param {number} level The level of the subpage being handled. | 356 * @param {number} level The level of the subpage being handled. |
357 * @return {Function} a function to handle clicks outside the given subpage. | 357 * @return {Function} a function to handle clicks outside the given subpage. |
358 * @private | 358 * @private |
359 */ | 359 */ |
360 OptionsPage.subPageClosingClickHandler_ = function(level) { | 360 OptionsPage.subPageClosingClickHandler_ = function(level) { |
361 var self = this; | 361 var self = this; |
362 return function(event) { | 362 return function(event) { |
363 // Clicks on the narrow strip between the left of the subpage sheet and | 363 // Clicks on the narrow strip between the left of the subpage sheet and |
364 // that shows part of the parent page should close the overlay, but | 364 // that shows part of the parent page should close the overlay, but |
365 // not fall through to the parent page. | 365 // not fall through to the parent page. |
366 if (!$('subpage-sheet-' + level).contains(event.target)) | 366 if (!$('subpage-sheet-' + level).contains(event.target)) { |
367 self.closeSubPagesToLevel(level - 1); | 367 self.closeSubPagesToLevel(level - 1); |
368 event.stopPropagation(); | 368 event.stopPropagation(); |
369 event.preventDefault(); | 369 event.preventDefault(); |
| 370 } |
370 }; | 371 }; |
371 }; | 372 }; |
372 | 373 |
373 /** | 374 /** |
374 * A function to handle mouse events (mousedown or click) on the html body by | 375 * A function to handle mouse events (mousedown or click) on the html body by |
375 * closing subpages and/or stopping event propagation. | 376 * closing subpages and/or stopping event propagation. |
376 * @return {Event} a mousedown or click event. | 377 * @return {Event} a mousedown or click event. |
377 * @private | 378 * @private |
378 */ | 379 */ |
379 OptionsPage.bodyMouseEventHandler_ = function(event) { | 380 OptionsPage.bodyMouseEventHandler_ = function(event) { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 OptionsPage.showOverlay(hash); | 575 OptionsPage.showOverlay(hash); |
575 }, | 576 }, |
576 }; | 577 }; |
577 | 578 |
578 // Export | 579 // Export |
579 return { | 580 return { |
580 OptionsPage: OptionsPage | 581 OptionsPage: OptionsPage |
581 }; | 582 }; |
582 | 583 |
583 }); | 584 }); |
OLD | NEW |