You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2013/08/27 16:15:29 UTC

git commit: updated refs/heads/master to 64ac2d6

Updated Branches:
  refs/heads/master e41edf5e6 -> 64ac2d60f


Fauxton: Factor disk size to own method


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

Branch: refs/heads/master
Commit: 64ac2d60f6788a8e39a45f5ca69761a1b8677684
Parents: e41edf5
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Aug 27 16:08:53 2013 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Aug 27 16:08:53 2013 +0200

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                       | 1 +
 src/fauxton/app/modules/databases/resources.js | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/64ac2d60/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index a548a9d..29a70ba 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -245,6 +245,7 @@ module.exports = function(grunt) {
       },
       options: {
         nospawn: true,
+        debounceDelay: 500
       }
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/64ac2d60/src/fauxton/app/modules/databases/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/resources.js b/src/fauxton/app/modules/databases/resources.js
index 04e6c1e..e019bdd 100644
--- a/src/fauxton/app/modules/databases/resources.js
+++ b/src/fauxton/app/modules/databases/resources.js
@@ -115,13 +115,17 @@ function(app, FauxtonAPI, Documents) {
       // cribbed from http://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable
       var i = -1;
       var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
-      var fileSizeInBytes = this.get("disk_size");
+      var fileSizeInBytes = this.diskSize();
       do {
           fileSizeInBytes = fileSizeInBytes / 1024;
           i++;
       } while (fileSizeInBytes > 1024);
 
       return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
+    },
+
+    diskSize: function () {
+      return this.get("disk_size");
     }
   });