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

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 1180733005: [DevTools] Added missing items to live anchor's context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/devtools/front_end/elements/ElementsPanel.js ('k') | 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 19 matching lines...) Expand all
30 /** 30 /**
31 * @constructor 31 * @constructor
32 * @extends {WebInspector.ElementsSidebarPane} 32 * @extends {WebInspector.ElementsSidebarPane}
33 * @param {function()} requestShowCallback 33 * @param {function()} requestShowCallback
34 */ 34 */
35 WebInspector.StylesSidebarPane = function(requestShowCallback) 35 WebInspector.StylesSidebarPane = function(requestShowCallback)
36 { 36 {
37 WebInspector.ElementsSidebarPane.call(this, WebInspector.UIString("Styles")) ; 37 WebInspector.ElementsSidebarPane.call(this, WebInspector.UIString("Styles")) ;
38 this.setMinimumSize(96, 26); 38 this.setMinimumSize(96, 26);
39 39
40 this.element.addEventListener("contextmenu", this._contextMenuEventFired.bin d(this), true);
41 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this)); 40 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this));
42 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this)); 41 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this));
43 42
44 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar "); 43 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar ");
45 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi lter-box"); 44 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi lter-box");
46 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this)); 45 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this));
47 filterContainerElement.appendChild(this._filterInput); 46 filterContainerElement.appendChild(this._filterInput);
48 47
49 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", hbox); 48 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", hbox);
50 toolbar.element.classList.add("styles-pane-toolbar"); 49 toolbar.element.classList.add("styles-pane-toolbar");
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 { 247 {
249 if (!oldMedia.parentStyleSheetId) 248 if (!oldMedia.parentStyleSheetId)
250 return; 249 return;
251 for (var block of this._sectionBlocks) { 250 for (var block of this._sectionBlocks) {
252 for (var section of block.sections) 251 for (var section of block.sections)
253 section._styleSheetMediaEdited(oldMedia, newMedia); 252 section._styleSheetMediaEdited(oldMedia, newMedia);
254 } 253 }
255 }, 254 },
256 255
257 /** 256 /**
258 * @param {!Event} event
259 */
260 _contextMenuEventFired: function(event)
261 {
262 // We start editing upon click -> default navigation to resources panel is not available
263 // Hence we add a soft context menu for hrefs.
264 var contextMenu = new WebInspector.ContextMenu(event);
265 contextMenu.appendApplicableItems(/** @type {!Node} */ (event.target));
266 contextMenu.show();
267 },
268
269 /**
270 * @param {string} propertyName 257 * @param {string} propertyName
271 */ 258 */
272 tracePropertyName: function(propertyName) 259 tracePropertyName: function(propertyName)
273 { 260 {
274 this._requestShowCallback(); 261 this._requestShowCallback();
275 this._filterInput.setFilterValue(WebInspector.CSSMetadata.canonicalPrope rtyName(propertyName)); 262 this._filterInput.setFilterValue(WebInspector.CSSMetadata.canonicalPrope rtyName(propertyName));
276 }, 263 },
277 264
278 /** 265 /**
279 * @param {?RegExp} regex 266 * @param {?RegExp} regex
(...skipping 2972 matching lines...) Expand 10 before | Expand all | Expand 10 after
3252 3239
3253 /** 3240 /**
3254 * @override 3241 * @override
3255 * @return {?WebInspector.ToolbarItem} 3242 * @return {?WebInspector.ToolbarItem}
3256 */ 3243 */
3257 item: function() 3244 item: function()
3258 { 3245 {
3259 return this._button; 3246 return this._button;
3260 } 3247 }
3261 } 3248 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/ElementsPanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698