OLD | NEW |
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 var codeMirror = window.CodeMirror(element, { | 65 var codeMirror = window.CodeMirror(element, { |
66 mode: config.mode, | 66 mode: config.mode, |
67 lineWrapping: config.lineWrapping, | 67 lineWrapping: config.lineWrapping, |
68 smartIndent: config.smartIndent, | 68 smartIndent: config.smartIndent, |
69 autofocus: true, | 69 autofocus: true, |
70 theme: config.theme, | 70 theme: config.theme, |
71 value: config.initialValue | 71 value: config.initialValue |
72 }); | 72 }); |
73 codeMirror.getWrapperElement().classList.add("source-code"); | 73 codeMirror.getWrapperElement().classList.add("source-code"); |
74 codeMirror.on("cursorActivity", function(cm) { | 74 codeMirror.on("cursorActivity", function(cm) { |
75 cm.display.cursor.scrollIntoViewIfNeeded(false); | 75 cm.display.cursorDiv.scrollIntoViewIfNeeded(false); |
76 }); | 76 }); |
77 editingContext.codeMirror = codeMirror; | 77 editingContext.codeMirror = codeMirror; |
78 }, | 78 }, |
79 | 79 |
80 closeEditor: function(editingContext) | 80 closeEditor: function(editingContext) |
81 { | 81 { |
82 editingContext.element.removeEventListener("copy", this._consumeCopy, fa
lse); | 82 editingContext.element.removeEventListener("copy", this._consumeCopy, fa
lse); |
83 editingContext.cssLoadView.detach(); | 83 editingContext.cssLoadView.detach(); |
84 }, | 84 }, |
85 | 85 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 { | 144 { |
145 WebInspector.VBox.call(this); | 145 WebInspector.VBox.call(this); |
146 this.element.classList.add("hidden"); | 146 this.element.classList.add("hidden"); |
147 this.registerRequiredCSS("cm/codemirror.css"); | 147 this.registerRequiredCSS("cm/codemirror.css"); |
148 this.registerRequiredCSS("cm/cmdevtools.css"); | 148 this.registerRequiredCSS("cm/cmdevtools.css"); |
149 } | 149 } |
150 | 150 |
151 WebInspector.CodeMirrorCSSLoadView.prototype = { | 151 WebInspector.CodeMirrorCSSLoadView.prototype = { |
152 __proto__: WebInspector.VBox.prototype | 152 __proto__: WebInspector.VBox.prototype |
153 } | 153 } |
OLD | NEW |