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

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

Issue 1343293005: Devtools: Fix frontend part of LayoutEditor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reupload after merge Created 5 years, 3 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
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 27 matching lines...) Expand all
38 38
39 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this)); 39 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this));
40 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this)); 40 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this));
41 41
42 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar "); 42 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar ");
43 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi lter-box"); 43 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi lter-box");
44 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this)); 44 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this));
45 filterContainerElement.appendChild(this._filterInput); 45 filterContainerElement.appendChild(this._filterInput);
46 46
47 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", hbox); 47 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", hbox);
48 if (Runtime.experiments.isEnabled("layoutEditor") && !Runtime.queryParam("re moteFrontend")) {
49 this._layoutEditorButton = new WebInspector.ToolbarButton(WebInspector.U IString("Toggle Layout Editor"), "layout-editor-toolbar-item");
50 toolbar.appendToolbarItem(this._layoutEditorButton);
51 this._layoutEditorButton.addEventListener("click", this._toggleLayoutEdi tor, this);
52 toolbar.appendSeparator();
53 }
54 48
55 toolbar.element.classList.add("styles-pane-toolbar", "toolbar-gray-toggled") ; 49 toolbar.element.classList.add("styles-pane-toolbar", "toolbar-gray-toggled") ;
56 this._currentToolbarPane = null; 50 this._currentToolbarPane = null;
57 51
58 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t oolbar-pane-container"); 52 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t oolbar-pane-container");
59 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s idebar-toolbar-pane"); 53 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s idebar-toolbar-pane");
60 this._sectionsContainer = this.element.createChild("div"); 54 this._sectionsContainer = this.element.createChild("div");
61 55
62 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper(); 56 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper();
63 57
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // IE hack. 130 // IE hack.
137 if (value.endsWith("\9")) 131 if (value.endsWith("\9"))
138 return true; 132 return true;
139 if (hasUnknownVendorPrefix(value)) 133 if (hasUnknownVendorPrefix(value))
140 return true; 134 return true;
141 135
142 return false; 136 return false;
143 } 137 }
144 138
145 WebInspector.StylesSidebarPane.prototype = { 139 WebInspector.StylesSidebarPane.prototype = {
146 _toggleLayoutEditor: function()
147 {
148 this._showLayoutEditor = !this._showLayoutEditor;
149 this._layoutEditorButton.setToggled(this._showLayoutEditor);
150 var targets = WebInspector.targetManager.targets();
151
152 if (this._showLayoutEditor)
153 WebInspector.inspectElementModeController.disable();
154 else
155 WebInspector.inspectElementModeController.enable();
156
157 var mode = this._showLayoutEditor ? DOMAgent.InspectMode.ShowLayoutEdito r : DOMAgent.InspectMode.None;
158 for (var domModel of WebInspector.DOMModel.instances())
159 domModel.setInspectMode(mode);
160 },
161 140
162 onUndoOrRedoHappened: function() 141 onUndoOrRedoHappened: function()
163 { 142 {
164 this.setNode(this.node()); 143 this.setNode(this.node());
165 }, 144 },
166 145
167 /** 146 /**
168 * @param {!WebInspector.Event} event 147 * @param {!WebInspector.Event} event
169 */ 148 */
170 _onAddButtonLongClick: function(event) 149 _onAddButtonLongClick: function(event)
(...skipping 2960 matching lines...) Expand 10 before | Expand all | Expand 10 after
3131 3110
3132 /** 3111 /**
3133 * @override 3112 * @override
3134 * @return {?WebInspector.ToolbarItem} 3113 * @return {?WebInspector.ToolbarItem}
3135 */ 3114 */
3136 item: function() 3115 item: function()
3137 { 3116 {
3138 return this._button; 3117 return this._button;
3139 } 3118 }
3140 } 3119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698