diff options
author | Simon Metson <simon+github@cloudant.com> | 2014-01-26 19:05:22 +0000 |
---|---|---|
committer | suelockwood <deathbear@apache.org> | 2014-01-29 10:34:28 -0500 |
commit | af4a1b9dd3d68e5a722a5f1ccf3565491cfbfd2d (patch) | |
tree | 0011c994649e2e1f70a0d5de08c6512b78e2ad57 | |
parent | 96be583d8566536b0356296d4f9b01164e31f4fc (diff) | |
download | couchdb-af4a1b9dd3d68e5a722a5f1ccf3565491cfbfd2d.tar.gz |
Whitespace
-rw-r--r-- | src/fauxton/app/addons/documents/views.js | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js index aeb5983b1..93fd0d48a 100644 --- a/src/fauxton/app/addons/documents/views.js +++ b/src/fauxton/app/addons/documents/views.js @@ -136,7 +136,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum template: "addons/documents/templates/upload_modal", disableLoader: true, - + initialize: function (options) { _.bindAll(this); }, @@ -201,7 +201,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.$('.progress').addClass('hide'); this.clear_error_msg(); this.$('.modal').modal(); - // hack to get modal visible + // hack to get modal visible $('.modal-backdrop').css('z-index',1025); }, @@ -257,7 +257,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.$('.progress').addClass('hide'); this.clear_error_msg(); this.$('.modal').modal(); - // hack to get modal visible + // hack to get modal visible $('.modal-backdrop').css('z-index',1025); }, @@ -400,8 +400,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum }, destroy: function (event) { - event.preventDefault(); - + event.preventDefault(); + window.alert('Cannot delete a document generated from a view.'); }, @@ -453,7 +453,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.newView = options.newView || false; this.showNumbers = options.showNumbers; this.pagination = options.pagination; - + this.listenTo(this.collection, 'totalRows:decrement', this.render); }, @@ -667,7 +667,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum }); model.collection.remove(model.id); - if (!!model.id.match('_design')) { + if (!!model.id.match('_design')) { FauxtonAPI.triggerRouteEvent('reloadDesignDocs'); } that.$('.bulk-delete').addClass('disabled'); @@ -712,13 +712,13 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum return true; }, - + nextUrlfn: function () { return collection.urlNextPage(perPage()); } }); }, - + cleanup: function () { this.allDocsNumber.remove(); _.each(this.rows, function (row) {row.remove();}); @@ -869,12 +869,12 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum } deferred.reject(); }); - + return deferred; }, saveDoc: function(event) { - var json, notification, + var json, notification, that = this, editor = this.editor, validDoc = this.getDocFromEditor(); @@ -1357,7 +1357,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum ddoc.removeDdocView(viewName); if (ddoc.hasViews()) { - promise = ddoc.save(); + promise = ddoc.save(); } else { promise = ddoc.destroy(); } @@ -1377,7 +1377,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum $('#dashboard-content').scrollTop(0); //scroll up if (this.hasValidCode() && this.$('#new-ddoc:visible').val() !=="") { - var mapVal = this.mapEditor.getValue(), + var mapVal = this.mapEditor.getValue(), reduceVal = this.reduceVal(), viewName = this.$('#index-name').val(), ddoc = this.getCurrentDesignDoc(), @@ -1428,7 +1428,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum if (that.reduceFunStr !== reduceVal) { that.reduceFunStr = reduceVal; - that.advancedOptions.renderOnUpdatehasReduce(that.hasReduce()); + that.advancedOptions.renderOnUpdatehasReduce(that.hasReduce()); } FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: ddocName, view: viewName}); @@ -1454,15 +1454,15 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum updateView: function(event, paramInfo) { event.preventDefault(); - + if (this.newView) { return alert('Please save this new view before querying it.'); } - + var errorParams = paramInfo.errorParams, params = paramInfo.params; - + if (_.any(errorParams)) { _.map(errorParams, function(param) { - + // TODO: Where to add this error? // bootstrap wants the error on a control-group div, but we're not using that //$('form.view-query-update input[name='+param+'], form.view-query-update select[name='+param+']').addClass('error'); @@ -1479,14 +1479,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum selector: ".advanced-options .errors-container", clear: true }); - + return false; } - + var fragment = window.location.hash.replace(/\?.*$/, ''); fragment = fragment + '?' + $.param(params); FauxtonAPI.navigate(fragment, {trigger: false}); - + FauxtonAPI.triggerRouteEvent('updateAllDocs', {ddoc: this.ddocID, view: this.viewName}); }, @@ -1537,7 +1537,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum getCurrentDesignDoc: function () { return this.designDocSelector.getCurrentDesignDoc(); }, - + isCustomReduceEnabled: function() { return $("#reduce-function-selector").val() == "CUSTOM"; }, @@ -1570,7 +1570,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum var editor = this[editorName]; if (editorName === "reduceEditor" && ! this.isCustomReduceEnabled()) { return true; - } + } return editor.hadValidCode(); }, this); }, @@ -1657,7 +1657,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum ddocName: this.model.id, database: this.database })); - + this.advancedOptions = this.insertView('#query', new Views.AdvancedOptions({ updateViewFn: this.updateView, previewFn: this.previewView, @@ -1703,7 +1703,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum this.mapEditor.setValue(this.langTemplates[this.defaultLang].map); //Use a built in view by default //this.reduceEditor.setValue(this.langTemplates[this.defaultLang].reduce); - } + } this.mapEditor.editSaved(); this.reduceEditor && this.reduceEditor.editSaved(); @@ -1800,7 +1800,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum permissions_url: '#' + this.database.url('app') + '/permissions', db_url: '#' + this.database.url('index') + '?limit=' + Databases.DocLimit, database: this.collection.database, - database_url: '#' + this.database.url('app'), + database_url: '#' + this.database.url('app'), docLinks: docLinks, docLimit: Databases.DocLimit, addLinks: addLinks, |