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

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

Issue 1846433002: DevTools: [SSP] accept editing on mouse click (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 2374 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 function blurListener(context, event) 2385 function blurListener(context, event)
2386 { 2386 {
2387 var treeElement = this._parentPane._mouseDownTreeElement; 2387 var treeElement = this._parentPane._mouseDownTreeElement;
2388 var moveDirection = ""; 2388 var moveDirection = "";
2389 if (treeElement === this) { 2389 if (treeElement === this) {
2390 if (isEditingName && this._parentPane._mouseDownTreeElementIsVal ue) 2390 if (isEditingName && this._parentPane._mouseDownTreeElementIsVal ue)
2391 moveDirection = "forward"; 2391 moveDirection = "forward";
2392 if (!isEditingName && this._parentPane._mouseDownTreeElementIsNa me) 2392 if (!isEditingName && this._parentPane._mouseDownTreeElementIsNa me)
2393 moveDirection = "backward"; 2393 moveDirection = "backward";
2394 } 2394 }
2395 this.editingCommitted((context.isEditingName ? this.name : this.valu e) || event.target.textContent, context, moveDirection); 2395 var text = event.target.textContent;
2396 if (!context.isEditingName)
2397 text = this.value || text;
2398 this.editingCommitted(text, context, moveDirection);
2396 } 2399 }
2397 2400
2398 this._originalPropertyText = this.property.propertyText; 2401 this._originalPropertyText = this.property.propertyText;
2399 2402
2400 this._parentPane.setEditingStyle(true); 2403 this._parentPane.setEditingStyle(true);
2401 if (selectElement.parentElement) 2404 if (selectElement.parentElement)
2402 selectElement.parentElement.scrollIntoViewIfNeeded(false); 2405 selectElement.parentElement.scrollIntoViewIfNeeded(false);
2403 2406
2404 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdi t.bind(this) : undefined; 2407 var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdi t.bind(this) : undefined;
2405 this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(isEd itingName ? WebInspector.CSSMetadata.cssPropertiesMetainfo : WebInspector.CSSMet adata.keywordsForProperty(this.nameElement.textContent), this, isEditingName); 2408 this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(isEd itingName ? WebInspector.CSSMetadata.cssPropertiesMetainfo : WebInspector.CSSMet adata.keywordsForProperty(this.nameElement.textContent), this, isEditingName);
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
3087 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged); 3090 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged);
3088 onNodeChanged(); 3091 onNodeChanged();
3089 return button; 3092 return button;
3090 3093
3091 function onNodeChanged() 3094 function onNodeChanged()
3092 { 3095 {
3093 var node = WebInspector.context.flavor(WebInspector.DOMNode); 3096 var node = WebInspector.context.flavor(WebInspector.DOMNode);
3094 button.setEnabled(!!node); 3097 button.setEnabled(!!node);
3095 } 3098 }
3096 } 3099 }
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