OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * FocusManager implementation specialized for Print Preview, which ensures | 9 * FocusManager implementation specialized for Print Preview, which ensures |
10 * that Print Preview itself does not receive focus when an overlay is shown. | 10 * that Print Preview itself does not receive focus when an overlay is shown. |
11 * @constructor | 11 * @constructor |
12 * @extends {cr.ui.FocusManager} | 12 * @extends {cr.ui.FocusManager} |
13 */ | 13 */ |
14 function PrintPreviewFocusManager() { | 14 function PrintPreviewFocusManager() { |
15 }; | 15 } |
16 | 16 |
17 cr.addSingletonGetter(PrintPreviewFocusManager); | 17 cr.addSingletonGetter(PrintPreviewFocusManager); |
18 | 18 |
19 PrintPreviewFocusManager.prototype = { | 19 PrintPreviewFocusManager.prototype = { |
20 __proto__: cr.ui.FocusManager.prototype, | 20 __proto__: cr.ui.FocusManager.prototype, |
21 | 21 |
22 /** @override */ | 22 /** @override */ |
23 getFocusParent: function() { | 23 getFocusParent: function() { |
24 var el = document.body; | 24 var el = document.body; |
25 var newEl = null; | 25 var newEl = null; |
26 while (newEl = el.querySelector('.overlay:not([hidden])')) | 26 while ((newEl = el.querySelector('.overlay:not([hidden])'))) |
dpapad
2017/05/05 23:30:29
That was probably an auto-fix for linter for http:
rbpotter
2017/05/06 00:02:19
Done.
| |
27 el = newEl; | 27 el = newEl; |
28 return el; | 28 return el; |
29 } | 29 } |
30 }; | 30 }; |
31 | 31 |
32 // Export | 32 // Export |
33 return { | 33 return { |
34 PrintPreviewFocusManager: PrintPreviewFocusManager | 34 PrintPreviewFocusManager: PrintPreviewFocusManager |
35 }; | 35 }; |
36 }); | 36 }); |
OLD | NEW |