Puste implementacje DocumentModel.merge i DocumentModel.update.
authorzuber <marek@stepniowski.com>
Tue, 29 Sep 2009 12:47:48 +0000 (14:47 +0200)
committerzuber <marek@stepniowski.com>
Tue, 29 Sep 2009 12:47:48 +0000 (14:47 +0200)
project/static/js/models.js
project/static/js/views/editor.js

index 0402e6d..75720a0 100644 (file)
@@ -230,7 +230,7 @@ Editor.DocumentModel = Editor.Model.extend({
     }
   },
   
-  updateDirtyContentModel: function(message) {
+  saveDirtyContentModel: function(message) {
     for (var key in this.contentModels) {
       if (this.contentModels[key].get('state') == 'dirty') {
         this.contentModels[key].update(message);
@@ -239,6 +239,14 @@ Editor.DocumentModel = Editor.Model.extend({
     }
   },
   
+  update: function() {
+    
+  },
+  
+  merge: function() {
+    
+  },
+  
   // For debbuging
   set: function(property, value) {
     if (property == 'state') {
index 49b5e02..04e22c8 100644 (file)
@@ -45,7 +45,19 @@ var EditorView = View.extend({
   },
   
   doCommit: function(message) {
-    this.model.updateDirtyContentModel(message);
+    this.model.saveDirtyContentModel(message);
+  },
+  
+  update: function(event) {
+    this.model.update();
+  },
+  
+  merge: function(event) {
+    $('#commit-dialog', this.element).jqmShow({callback: this.doMerge.bind(this)});
+  },
+  
+  doMerge: function(message) {
+    this.model.merge(message);
   },
   
   loadRelatedIssues: function(hash) {
@@ -73,28 +85,22 @@ var EditorView = View.extend({
     $("div.fatal-error-box", c).hide();
     $("div.container-box", c).hide();
     
-    // $.getJSON(c.attr('ui:ajax-src') + '?callback=?',
-    // function(data, status)
-    // {
-    //     var fmt = '';
-    //     $(data).each( function() {
-    //         fmt += '<label><input type="checkbox" checked="checked"'
-    //         fmt += ' value="' + this.id + '" />' + this.subject +'</label>\n'
-    //     });
-    //     $("div.container-box", c).html(fmt);
-    //     $("div.loading-box", c).hide();
-    //     $("div.container-box", c).show();        
-    // });   
+    $.getJSON(c.attr('ui:ajax-src') + '?callback=?',
+    function(data, status)
+    {
+        var fmt = '';
+        $(data).each( function() {
+            fmt += '<label><input type="checkbox" checked="checked"';
+            fmt += ' value="' + this.id + '" />' + this.subject +'</label>\n';
+        });
+        $("div.container-box", c).html(fmt);
+        $("div.loading-box", c).hide();
+        $("div.container-box", c).show();        
+    });   
     
     hash.w.show();
   },
   
-  update: function(event) {
-  },
-  
-  merge: function(event) {
-  },
-  
   modelStateChanged: function(property, value) {
     // Uaktualnia stan przycisków
     if (value == 'dirty') {