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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Dialog.js

Issue 2706293007: [DevTools] Fix Dialog's close button to properly close dialog. (Closed)
Patch Set: Created 3 years, 10 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 | 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 /* 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 hideDialog() { 70 hideDialog() {
71 this._focusRestorer.restore(); 71 this._focusRestorer.restore();
72 this.hideGlassPane(); 72 this.hideGlassPane();
73 this._restoreTabIndexOnElements(); 73 this._restoreTabIndexOnElements();
74 delete UI.Dialog._instance; 74 delete UI.Dialog._instance;
75 } 75 }
76 76
77 addCloseButton() { 77 addCloseButton() {
78 var closeButton = this.contentElement.createChild('div', 'dialog-close-butto n', 'dt-close-button'); 78 var closeButton = this.contentElement.createChild('div', 'dialog-close-butto n', 'dt-close-button');
79 closeButton.gray = true; 79 closeButton.gray = true;
80 closeButton.addEventListener('click', () => this.detach(), false); 80 closeButton.addEventListener('click', () => this.hideDialog(), false);
caseq 2017/02/21 22:56:29 So it looks like calling detach() on this one is a
dgozman 2017/02/21 23:01:47 I can try to do that in a follow up.
81 } 81 }
82 82
83 /** 83 /**
84 * @param {!Document} document 84 * @param {!Document} document
85 */ 85 */
86 _disableTabIndexOnElements(document) { 86 _disableTabIndexOnElements(document) {
87 this._tabIndexMap.clear(); 87 this._tabIndexMap.clear();
88 for (var node = document; node; node = node.traverseNextNode(document)) { 88 for (var node = document; node; node = node.traverseNextNode(document)) {
89 if (node instanceof HTMLElement) { 89 if (node instanceof HTMLElement) {
90 var element = /** @type {!HTMLElement} */ (node); 90 var element = /** @type {!HTMLElement} */ (node);
(...skipping 15 matching lines...) Expand all
106 /** 106 /**
107 * @param {!Event} event 107 * @param {!Event} event
108 */ 108 */
109 _onKeyDown(event) { 109 _onKeyDown(event) {
110 if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code) { 110 if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code) {
111 event.consume(true); 111 event.consume(true);
112 this.hideDialog(); 112 this.hideDialog();
113 } 113 }
114 } 114 }
115 }; 115 };
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