Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D257410FEB for ; Tue, 10 Sep 2013 14:03:56 +0000 (UTC) Received: (qmail 64607 invoked by uid 500); 10 Sep 2013 14:03:54 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 64180 invoked by uid 500); 10 Sep 2013 14:03:52 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 63824 invoked by uid 99); 10 Sep 2013 14:03:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Sep 2013 14:03:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A2F2089F2D8; Tue, 10 Sep 2013 14:03:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: garren@apache.org To: commits@couchdb.apache.org Date: Tue, 10 Sep 2013 14:03:50 -0000 Message-Id: In-Reply-To: <32bde6e8d1c142a5b9dab563d90e31d4@git.apache.org> References: <32bde6e8d1c142a5b9dab563d90e31d4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/14] git commit: updated refs/heads/index-pagination to db85b98 Fix order of action buttons in the editor Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/0bc81f93 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/0bc81f93 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/0bc81f93 Branch: refs/heads/index-pagination Commit: 0bc81f93430153b678d4484371263de8b504b0a6 Parents: 8c8e5a4 Author: suelockwood Authored: Fri Sep 6 14:19:39 2013 -0400 Committer: suelockwood Committed: Fri Sep 6 14:19:39 2013 -0400 ---------------------------------------------------------------------- src/fauxton/app/modules/documents/views.js | 127 +++++++++---------- src/fauxton/app/templates/documents/doc.html | 15 ++- .../documents/doc_field_editor_tabs.html | 15 +-- src/fauxton/assets/less/database.less | 9 ++ 4 files changed, 85 insertions(+), 81 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bc81f93/src/fauxton/app/modules/documents/views.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js index 805116e..83e1e8f 100644 --- a/src/fauxton/app/modules/documents/views.js +++ b/src/fauxton/app/modules/documents/views.js @@ -298,71 +298,7 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns) }, events: { - "click button.delete": "destroy", - "click button.duplicate": "duplicate", - "click button.upload": "upload" - }, - - destroy: function(event) { - if (this.model.isNewDoc()) { - FauxtonAPI.addNotification({ - msg: 'This document has not been saved yet.', - type: 'warning' - }); - return; - } - - if (!window.confirm("Are you sure you want to delete this doc?")) { - return false; - } - - var database = this.model.database; - - this.model.destroy().then(function(resp) { - FauxtonAPI.addNotification({ - msg: "Succesfully destroyed your doc" - }); - FauxtonAPI.navigate(database.url("index")); - }, function(resp) { - FauxtonAPI.addNotification({ - msg: "Failed to destroy your doc!", - type: "error" - }); - }); - }, - - beforeRender: function () { - this.uploadModal = this.setView('#upload-modal', new Views.UploadModal({model: this.model})); - this.uploadModal.render(); - - this.duplicateModal = this.setView('#duplicate-modal', new Views.DuplicateDocModal({model: this.model})); - this.duplicateModal.render(); - }, - - upload: function (event) { - event.preventDefault(); - if (this.model.isNewDoc()) { - FauxtonAPI.addNotification({ - msg: 'Please save the document before uploading an attachment.', - type: 'warning' - }); - return; - } - this.uploadModal.showModal(); - }, - - duplicate: function(event) { - if (this.model.isNewDoc()) { - FauxtonAPI.addNotification({ - msg: 'Please save the document before duplicating it.', - type: 'warning' - }); - return; - } - event.preventDefault(); - this.duplicateModal.showModal(); }, - updateSelected: function (selected) { this.selected = selected; this.$('.active').removeClass('active'); @@ -590,13 +526,74 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns) Views.Doc = FauxtonAPI.View.extend({ template: "templates/documents/doc", events: { - "click button.save-doc": "saveDoc" + "click button.save-doc": "saveDoc", + "click button.delete": "destroy", + "click button.duplicate": "duplicate", + "click button.upload": "upload" }, disableLoader: true, initialize: function (options) { this.database = options.database; }, + destroy: function(event) { + if (this.model.isNewDoc()) { + FauxtonAPI.addNotification({ + msg: 'This document has not been saved yet.', + type: 'warning' + }); + return; + } + + if (!window.confirm("Are you sure you want to delete this doc?")) { + return false; + } + + var database = this.model.database; + + this.model.destroy().then(function(resp) { + FauxtonAPI.addNotification({ + msg: "Succesfully destroyed your doc" + }); + FauxtonAPI.navigate(database.url("index")); + }, function(resp) { + FauxtonAPI.addNotification({ + msg: "Failed to destroy your doc!", + type: "error" + }); + }); + }, + beforeRender: function () { + this.uploadModal = this.setView('#upload-modal', new Views.UploadModal({model: this.model})); + this.uploadModal.render(); + + this.duplicateModal = this.setView('#duplicate-modal', new Views.DuplicateDocModal({model: this.model})); + this.duplicateModal.render(); + }, + + upload: function (event) { + event.preventDefault(); + if (this.model.isNewDoc()) { + FauxtonAPI.addNotification({ + msg: 'Please save the document before uploading an attachment.', + type: 'warning' + }); + return; + } + this.uploadModal.showModal(); + }, + + duplicate: function(event) { + if (this.model.isNewDoc()) { + FauxtonAPI.addNotification({ + msg: 'Please save the document before duplicating it.', + type: 'warning' + }); + return; + } + event.preventDefault(); + this.duplicateModal.showModal(); + }, updateValues: function() { var notification; if (this.model.changedAttributes()) { http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bc81f93/src/fauxton/app/templates/documents/doc.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/templates/documents/doc.html b/src/fauxton/app/templates/documents/doc.html index d6577af..6d4c8e5 100644 --- a/src/fauxton/app/templates/documents/doc.html +++ b/src/fauxton/app/templates/documents/doc.html @@ -14,8 +14,9 @@ the License.
+ +
http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bc81f93/src/fauxton/app/templates/documents/doc_field_editor_tabs.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/templates/documents/doc_field_editor_tabs.html b/src/fauxton/app/templates/documents/doc_field_editor_tabs.html index 29c6d8b..af34b71 100644 --- a/src/fauxton/app/templates/documents/doc_field_editor_tabs.html +++ b/src/fauxton/app/templates/documents/doc_field_editor_tabs.html @@ -14,17 +14,6 @@ the License.
- -
-
http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bc81f93/src/fauxton/assets/less/database.less ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/database.less b/src/fauxton/assets/less/database.less index 3854bcd..e1862d9 100644 --- a/src/fauxton/assets/less/database.less +++ b/src/fauxton/assets/less/database.less @@ -191,3 +191,12 @@ table.active-tasks{ } } + +#doc { + .dropdown-menu{ + width: auto; + } +} +#tabs { + height: 40px; +}