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

Side by Side Diff: Source/devtools/front_end/source_frame/CodeMirrorUtils.js

Issue 334393004: DevTools: Always construct CodeMirror explicitly, via "new" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/source_frame/CodeMirrorTextEditor.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 }, 77 },
78 78
79 setUpEditor: function(editingContext) 79 setUpEditor: function(editingContext)
80 { 80 {
81 var element = editingContext.element; 81 var element = editingContext.element;
82 var config = editingContext.config; 82 var config = editingContext.config;
83 editingContext.cssLoadView = new WebInspector.CodeMirrorCSSLoadView(); 83 editingContext.cssLoadView = new WebInspector.CodeMirrorCSSLoadView();
84 editingContext.cssLoadView.show(element); 84 editingContext.cssLoadView.show(element);
85 WebInspector.setCurrentFocusElement(element); 85 WebInspector.setCurrentFocusElement(element);
86 element.addEventListener("copy", this._consumeCopy, false); 86 element.addEventListener("copy", this._consumeCopy, false);
87 var codeMirror = window.CodeMirror(element, { 87 var codeMirror = new window.CodeMirror(element, {
88 mode: config.mode, 88 mode: config.mode,
89 lineWrapping: config.lineWrapping, 89 lineWrapping: config.lineWrapping,
90 smartIndent: config.smartIndent, 90 smartIndent: config.smartIndent,
91 autofocus: true, 91 autofocus: true,
92 theme: config.theme, 92 theme: config.theme,
93 value: config.initialValue 93 value: config.initialValue
94 }); 94 });
95 codeMirror.getWrapperElement().classList.add("source-code"); 95 codeMirror.getWrapperElement().classList.add("source-code");
96 codeMirror.on("cursorActivity", function(cm) { 96 codeMirror.on("cursorActivity", function(cm) {
97 cm.display.cursorDiv.scrollIntoViewIfNeeded(false); 97 cm.display.cursorDiv.scrollIntoViewIfNeeded(false);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 { 166 {
167 WebInspector.VBox.call(this); 167 WebInspector.VBox.call(this);
168 this.element.classList.add("hidden"); 168 this.element.classList.add("hidden");
169 this.registerRequiredCSS("cm/codemirror.css"); 169 this.registerRequiredCSS("cm/codemirror.css");
170 this.registerRequiredCSS("cm/cmdevtools.css"); 170 this.registerRequiredCSS("cm/cmdevtools.css");
171 } 171 }
172 172
173 WebInspector.CodeMirrorCSSLoadView.prototype = { 173 WebInspector.CodeMirrorCSSLoadView.prototype = {
174 __proto__: WebInspector.VBox.prototype 174 __proto__: WebInspector.VBox.prototype
175 } 175 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698