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

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

Issue 1847303005: DevTools: [SSP] accept editing on mouse click (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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) 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 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2424 function blurListener(context, event) 2424 function blurListener(context, event)
2425 { 2425 {
2426 var treeElement = this._parentPane._mouseDownTreeElement; 2426 var treeElement = this._parentPane._mouseDownTreeElement;
2427 var moveDirection = ""; 2427 var moveDirection = "";
2428 if (treeElement === this) { 2428 if (treeElement === this) {
2429 if (isEditingName && this._parentPane._mouseDownTreeElementIsVal ue) 2429 if (isEditingName && this._parentPane._mouseDownTreeElementIsVal ue)
2430 moveDirection = "forward"; 2430 moveDirection = "forward";
2431 if (!isEditingName && this._parentPane._mouseDownTreeElementIsNa me) 2431 if (!isEditingName && this._parentPane._mouseDownTreeElementIsNa me)
2432 moveDirection = "backward"; 2432 moveDirection = "backward";
2433 } 2433 }
2434 this.editingCommitted((context.isEditingName ? this.name : this.valu e) || event.target.textContent, context, moveDirection); 2434 var text = event.target.textContent;
2435 if (!context.isEditingName)
2436 text = this.value || text;
2437 this.editingCommitted(text, context, moveDirection);
2435 } 2438 }
2436 2439
2437 this._originalPropertyText = this.property.propertyText; 2440 this._originalPropertyText = this.property.propertyText;
2438 2441
2439 this._parentPane.setEditingStyle(true); 2442 this._parentPane.setEditingStyle(true);
2440 if (selectElement.parentElement) 2443 if (selectElement.parentElement)
2441 selectElement.parentElement.scrollIntoViewIfNeeded(false); 2444 selectElement.parentElement.scrollIntoViewIfNeeded(false);
2442 2445
2443 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdi t.bind(this) : undefined; 2446 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdi t.bind(this) : undefined;
2444 this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(isEd itingName ? WebInspector.CSSMetadata.cssPropertiesMetainfo : WebInspector.CSSMet adata.keywordsForProperty(this.nameElement.textContent), this, isEditingName); 2447 this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(isEd itingName ? WebInspector.CSSMetadata.cssPropertiesMetainfo : WebInspector.CSSMet adata.keywordsForProperty(this.nameElement.textContent), this, isEditingName);
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
3124 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged); 3127 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged);
3125 onNodeChanged(); 3128 onNodeChanged();
3126 return button; 3129 return button;
3127 3130
3128 function onNodeChanged() 3131 function onNodeChanged()
3129 { 3132 {
3130 var node = WebInspector.context.flavor(WebInspector.DOMNode); 3133 var node = WebInspector.context.flavor(WebInspector.DOMNode);
3131 button.setEnabled(!!node); 3134 button.setEnabled(!!node);
3132 } 3135 }
3133 } 3136 }
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