couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to 4eec2c8
Date Thu, 30 Oct 2014 16:08:04 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master c444e1fd6 -> 4eec2c8b9


Allow the <enter> key to submit the Add New Database form

Closes COUCHDB-2418


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/4eec2c8b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/4eec2c8b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/4eec2c8b

Branch: refs/heads/master
Commit: 4eec2c8b9e05727beb126c7bad6eea28b05edbf4
Parents: c444e1f
Author: Benjamin Keen <ben.keen@gmail.com>
Authored: Wed Oct 29 17:46:32 2014 -0700
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Thu Oct 30 17:07:05 2014 +0100

----------------------------------------------------------------------
 app/addons/databases/assets/less/databases.less |  2 +-
 app/addons/databases/templates/newdatabase.html |  2 +-
 app/addons/databases/views.js                   | 11 +++++++++--
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4eec2c8b/app/addons/databases/assets/less/databases.less
----------------------------------------------------------------------
diff --git a/app/addons/databases/assets/less/databases.less b/app/addons/databases/assets/less/databases.less
index fb220dd..d4d357c 100644
--- a/app/addons/databases/assets/less/databases.less
+++ b/app/addons/databases/assets/less/databases.less
@@ -49,7 +49,7 @@
     right: 153px;
   }
 
-  #new-database-name {
+  .input-xxlarge {
     margin-bottom: 0px;
     width: 250px;
     .border-radius(5px 0 0 5px);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4eec2c8b/app/addons/databases/templates/newdatabase.html
----------------------------------------------------------------------
diff --git a/app/addons/databases/templates/newdatabase.html b/app/addons/databases/templates/newdatabase.html
index f2220c5..dfee69d 100644
--- a/app/addons/databases/templates/newdatabase.html
+++ b/app/addons/databases/templates/newdatabase.html
@@ -15,6 +15,6 @@ the License.
 
 <div class="new-database-tray tray">
   <span class="add-on">Add New Database</span>
-  <input id="new-database-name" type="text" class="input-xxlarge" placeholder="Name of
database">
+  <input id="js-new-database-name" type="text" class="input-xxlarge" placeholder="Name
of database">
   <a class="btn" id="js-create-database">Create</a>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4eec2c8b/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js
index 09b3862..6f376da 100644
--- a/app/addons/databases/views.js
+++ b/app/addons/databases/views.js
@@ -188,7 +188,8 @@ function(app, Components, FauxtonAPI, Databases) {
     template: 'addons/databases/templates/newdatabase',
     events: {
       'click #add-new-database': 'toggleTray',
-      'click #js-create-database': 'createDatabase'
+      'click #js-create-database': 'createDatabase',
+      'keyup #js-new-database-name': 'processKey'
     },
 
     initialize: function () {
@@ -211,6 +212,12 @@ function(app, Components, FauxtonAPI, Databases) {
       $('body').off('click.add-new-database');
     },
 
+    processKey: function (e) {
+      if (e.which === 13) {
+        this.createDatabase(e);
+      }
+    },
+
     toggleTray: function (e) {
       e.preventDefault();
 
@@ -247,7 +254,7 @@ function(app, Components, FauxtonAPI, Databases) {
     createDatabase: function (e) {
       e.preventDefault();
 
-      var databaseName = $.trim(this.$('#new-database-name').val());
+      var databaseName = $.trim(this.$('#js-new-database-name').val());
       if (databaseName.length === 0) {
         FauxtonAPI.addNotification({
           msg: 'Please enter a valid database name',


Mime
View raw message