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

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

Issue 658483004: DevTools: fix DOM multiline editing, extract multiline editor API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/InplaceEditor.js » ('j') | 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, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 child = child.nextSibling; 1945 child = child.nextSibling;
1946 } 1946 }
1947 1947
1948 this.treeOutline.childrenListElement.parentElement.removeEventListen er("mousedown", consume, false); 1948 this.treeOutline.childrenListElement.parentElement.removeEventListen er("mousedown", consume, false);
1949 this.updateSelection(); 1949 this.updateSelection();
1950 this.treeOutline.element.focus(); 1950 this.treeOutline.element.focus();
1951 } 1951 }
1952 1952
1953 var config = new WebInspector.InplaceEditor.Config(commit.bind(this), di spose.bind(this)); 1953 var config = new WebInspector.InplaceEditor.Config(commit.bind(this), di spose.bind(this));
1954 config.setMultilineOptions(initialValue, { name: "xml", htmlMode: true } , "web-inspector-html", WebInspector.settings.domWordWrap.get(), true); 1954 config.setMultilineOptions(initialValue, { name: "xml", htmlMode: true } , "web-inspector-html", WebInspector.settings.domWordWrap.get(), true);
1955 self.runtime.instancePromise(WebInspector.InplaceEditor).then(markAsBein gEdited.bind(this)).done(); 1955 WebInspector.InplaceEditor.startMultilineEditing(this._htmlEditElement, config).then(markAsBeingEdited.bind(this)).done();
1956 1956
1957 /** 1957 /**
1958 * @param {!WebInspector.InplaceEditor} inplaceEditor 1958 * @param {!Object} controller
1959 * @this {WebInspector.ElementsTreeElement} 1959 * @this {WebInspector.ElementsTreeElement}
1960 */ 1960 */
1961 function markAsBeingEdited(inplaceEditor) 1961 function markAsBeingEdited(controller)
1962 { 1962 {
1963 this._editing = /** @type {!WebInspector.InplaceEditor} */ (inplaceE ditor).startEditing(this._htmlEditElement, config); 1963 this._editing = /** @type {!WebInspector.InplaceEditor.Controller} * / (controller);
1964 this._editing.setWidth(this.treeOutline._visibleWidth); 1964 this._editing.setWidth(this.treeOutline._visibleWidth);
1965 this.treeOutline._multilineEditing = this._editing; 1965 this.treeOutline._multilineEditing = this._editing;
1966 } 1966 }
1967 }, 1967 },
1968 1968
1969 _attributeEditingCommitted: function(element, newText, oldText, attributeNam e, moveDirection) 1969 _attributeEditingCommitted: function(element, newText, oldText, attributeNam e, moveDirection)
1970 { 1970 {
1971 delete this._editing; 1971 delete this._editing;
1972 1972
1973 var treeOutline = this.treeOutline; 1973 var treeOutline = this.treeOutline;
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2944 treeOutline.element.classList.add("outline-disclosure"); 2944 treeOutline.element.classList.add("outline-disclosure");
2945 if (!treeOutline.children[0].hasChildren) 2945 if (!treeOutline.children[0].hasChildren)
2946 treeOutline.element.classList.add("single-node"); 2946 treeOutline.element.classList.add("single-node");
2947 treeOutline.setVisible(true); 2947 treeOutline.setVisible(true);
2948 treeOutline.element.treeElementForTest = treeOutline.children[0] ; 2948 treeOutline.element.treeElementForTest = treeOutline.children[0] ;
2949 resolve(treeOutline.element); 2949 resolve(treeOutline.element);
2950 } 2950 }
2951 } 2951 }
2952 } 2952 }
2953 } 2953 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/InplaceEditor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698