From: zuber Date: Tue, 29 Sep 2009 12:47:48 +0000 (+0200) Subject: Puste implementacje DocumentModel.merge i DocumentModel.update. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/d71968e15d1f77dc04908f30237e37163d54efde?ds=inline;hp=-c Puste implementacje DocumentModel.merge i DocumentModel.update. --- d71968e15d1f77dc04908f30237e37163d54efde diff --git a/project/static/js/models.js b/project/static/js/models.js index 0402e6dd..75720a05 100644 --- a/project/static/js/models.js +++ b/project/static/js/models.js @@ -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') { diff --git a/project/static/js/views/editor.js b/project/static/js/views/editor.js index 49b5e022..04e22c86 100644 --- a/project/static/js/views/editor.js +++ b/project/static/js/views/editor.js @@ -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 += '\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 += '\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') {