summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarren Smith <garren.smith@gmail.com>2013-08-27 16:08:53 +0200
committerGarren Smith <garren.smith@gmail.com>2013-08-27 16:08:53 +0200
commit64ac2d60f6788a8e39a45f5ca69761a1b8677684 (patch)
tree85bd9b99d27eac5823d71c25c138b6857fcf85e4
parente41edf5e6263cb8b5cc81e837bfd41252f0c10bb (diff)
downloadcouchdb-64ac2d60f6788a8e39a45f5ca69761a1b8677684.tar.gz
Fauxton: Factor disk size to own method
-rw-r--r--src/fauxton/Gruntfile.js1
-rw-r--r--src/fauxton/app/modules/databases/resources.js6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index a548a9d98..29a70ba7a 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -245,6 +245,7 @@ module.exports = function(grunt) {
},
options: {
nospawn: true,
+ debounceDelay: 500
}
},
diff --git a/src/fauxton/app/modules/databases/resources.js b/src/fauxton/app/modules/databases/resources.js
index 04e6c1ecc..e019bdda2 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");
}
});