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: third_party/WebKit/Source/devtools/front_end/ui/Dialog.js

Issue 1922303004: DevTools: fix focus restoration from command menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary !! Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 if (WebInspector.Dialog._instance) 67 if (WebInspector.Dialog._instance)
68 WebInspector.Dialog._instance.detach(); 68 WebInspector.Dialog._instance.detach();
69 WebInspector.Dialog._instance = this; 69 WebInspector.Dialog._instance = this;
70 70
71 var document = /** @type {!Document} */ (WebInspector.Dialog._modalHostV iew.element.ownerDocument); 71 var document = /** @type {!Document} */ (WebInspector.Dialog._modalHostV iew.element.ownerDocument);
72 this._disableTabIndexOnElements(document); 72 this._disableTabIndexOnElements(document);
73 73
74 this._glassPane = new WebInspector.GlassPane(document, this._dimmed); 74 this._glassPane = new WebInspector.GlassPane(document, this._dimmed);
75 this._glassPane.element.addEventListener("click", this._onGlassPaneClick .bind(this), false); 75 this._glassPane.element.addEventListener("click", this._onGlassPaneClick .bind(this), false);
76 WebInspector.GlassPane.DefaultFocusedViewStack.push(this);
77 76
78 WebInspector.Widget.prototype.show.call(this, this._glassPane.element); 77 WebInspector.Widget.prototype.show.call(this, this._glassPane.element);
79 78
80 this._position(); 79 this._position();
81 this.focus(); 80 this.focus();
82 }, 81 },
83 82
84 /** 83 /**
85 * @override 84 * @override
86 */ 85 */
87 detach: function() 86 detach: function()
88 { 87 {
88 var previousFocusElement = WebInspector.previousFocusElement();
89 WebInspector.Widget.prototype.detach.call(this); 89 WebInspector.Widget.prototype.detach.call(this);
90
91 WebInspector.GlassPane.DefaultFocusedViewStack.pop();
92 this._glassPane.dispose(); 90 this._glassPane.dispose();
93 delete this._glassPane; 91 delete this._glassPane;
94 92
93 if (previousFocusElement)
94 previousFocusElement.focus();
95 this._restoreTabIndexOnElements(); 95 this._restoreTabIndexOnElements();
96 96
97 delete WebInspector.Dialog._instance; 97 delete WebInspector.Dialog._instance;
98 }, 98 },
99 99
100 addCloseButton: function() 100 addCloseButton: function()
101 { 101 {
102 var closeButton = this.contentElement.createChild("div", "dialog-close-b utton", "dt-close-button"); 102 var closeButton = this.contentElement.createChild("div", "dialog-close-b utton", "dt-close-button");
103 closeButton.gray = true; 103 closeButton.gray = true;
104 closeButton.addEventListener("click", this.detach.bind(this, false), fal se); 104 closeButton.addEventListener("click", this.detach.bind(this, false), fal se);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 { 251 {
252 return WebInspector.Dialog._modalHostView; 252 return WebInspector.Dialog._modalHostView;
253 }; 253 };
254 254
255 WebInspector.Dialog.modalHostRepositioned = function() 255 WebInspector.Dialog.modalHostRepositioned = function()
256 { 256 {
257 if (WebInspector.Dialog._instance) 257 if (WebInspector.Dialog._instance)
258 WebInspector.Dialog._instance._position(); 258 WebInspector.Dialog._instance._position();
259 }; 259 };
260 260
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698