]> git.r.bdr.sh - rbdr/dotfiles/blobdiff - atom/packages/ex-mode/node_modules/atom-space-pen-views/lib/text-editor-view.js
Adds atom packages
[rbdr/dotfiles] / atom / packages / ex-mode / node_modules / atom-space-pen-views / lib / text-editor-view.js
index e957a2bf041230fd6a7f9ee7efb253972a438d88..8aecdaf627be0520620dc31cc0db3056c1406496 100644 (file)
@@ -9,11 +9,11 @@
     __extends(TextEditorView, _super);
 
     function TextEditorView(params) {
-      var attributes, mini, name, placeholderText, value;
+      var attributes, editor, mini, name, placeholderText, value;
       if (params == null) {
         params = {};
       }
-      mini = params.mini, placeholderText = params.placeholderText, attributes = params.attributes;
+      mini = params.mini, placeholderText = params.placeholderText, attributes = params.attributes, editor = params.editor;
       if (attributes == null) {
         attributes = {};
       }
       if (placeholderText != null) {
         attributes['placeholder-text'] = placeholderText;
       }
-      this.element = document.createElement('atom-text-editor');
+      if (editor != null) {
+        this.element = atom.views.getView(editor);
+      } else {
+        this.element = document.createElement('atom-text-editor');
+      }
       for (name in attributes) {
         value = attributes[name];
         this.element.setAttribute(name, value);