Zastąpienie splittera zwykłym chowaniem i pokazywaniem po kliknięciu.
[redakcja.git] / platforma / static / js / views / xml.js
old mode 100644 (file)
new mode 100755 (executable)
index 1681cae..0dd5453
@@ -8,8 +8,11 @@ var XMLView = View.extend({
     buttonToolbar: null,
   
     init: function(element, model, parent, template) {
-        this._super(element, model, template);
+        var submodel = model.contentModels['xml'];
+        this._super(element, submodel, template);
+
         this.parent = parent;
+
         this.buttonToolbar = new ButtonToolbarView(
             $('.xmlview-toolbar', this.element),
             this.model.toolbarButtonsModel, parent);
@@ -24,10 +27,13 @@ var XMLView = View.extend({
         $(document).bind('xml-scroll-request', this.scrollCallback);
        
         this.parent.freeze('Ładowanie edytora...');
+
+        setTimeout((function(){
+
         this.editor = new CodeMirror($('.xmlview', this.element).get(0), {
             parserfile: 'parsexml.js',
-            path: "/static/js/lib/codemirror/",
-            stylesheet: "/static/css/xmlcolors.css",
+            path: documentInfo.staticURL + "js/lib/codemirror/",
+            stylesheet: documentInfo.staticURL + "css/xmlcolors.css",
             parserConfig: {
                 useHTMLKludges: false
             },
@@ -37,6 +43,8 @@ var XMLView = View.extend({
             onChange: this.editorDataChanged.bind(this),
             initCallback: this.editorDidLoad.bind(this)
         });
+
+        }).bind(this), 0);
     },
   
     resized: function(event) {
@@ -56,9 +64,7 @@ var XMLView = View.extend({
         this.model
         .addObserver(this, 'data', this.modelDataChanged.bind(this))
         .addObserver(this, 'state', this.modelStateChanged.bind(this))
-        .load();
-    
-        this.parent.unfreeze();
+        .load();           
       
         this.editor.setCode(this.model.get('data'));
         this.modelStateChanged('state', this.model.get('state'));
@@ -66,7 +72,9 @@ var XMLView = View.extend({
         editor.grabKeys(
             this.hotkeyPressed.bind(this),
             this.isHotkey.bind(this)
-            );
+        );
+
+        this.parent.unfreeze();
     },
   
     editorDataChanged: function() {
@@ -85,7 +93,7 @@ var XMLView = View.extend({
         } else if (value == 'unsynced') {
             this.freeze('Niezsynchronizowany...');
         } else if (value == 'loading') {
-            this.freeze('Ładowanie...');
+            this.freeze('Ładowanie danych...');
         } else if (value == 'saving') {
             this.freeze('Zapisywanie...');
         } else if (value == 'error') {