diff options
Diffstat (limited to 'src/fauxton/app/modules/documents/resources.js')
-rw-r--r-- | src/fauxton/app/modules/documents/resources.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/fauxton/app/modules/documents/resources.js b/src/fauxton/app/modules/documents/resources.js index 8fc384e17..bece38677 100644 --- a/src/fauxton/app/modules/documents/resources.js +++ b/src/fauxton/app/modules/documents/resources.js @@ -67,6 +67,10 @@ function(app, FauxtonAPI) { return views && _.keys(views).length > 0; }, + hasAttachments: function () { + return !!this.get('_attachments'); + }, + getDdocView: function(view) { if (!this.isDdoc() || !this.hasViews()) return false; @@ -109,7 +113,6 @@ function(app, FauxtonAPI) { var doc = this.get('doc'); if (doc) { - console.log('DOC', doc); return new Documents.Doc(doc, {database: this.database}); } @@ -161,6 +164,14 @@ function(app, FauxtonAPI) { var data = this.get("doc") ? this.get("doc") : this; return JSON.stringify(data, null, " "); + }, + + copy: function (copyId) { + return $.ajax({ + type: 'COPY', + url: '/' + this.database.id + '/' + this.id, + headers: {Destination: copyId} + }); } }); |