couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [36/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 8aad450
Date Mon, 09 Sep 2013 09:53:56 GMT
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/5ea41518
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5ea41518
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5ea41518

Branch: refs/heads/1867-feature-plugins
Commit: 5ea41518965c1dd7cd3353e42c02c17be06ca75b
Parents: 370dd17
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Aug 27 16:08:53 2013 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Mon Sep 9 11:16:45 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/5ea41518/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/5ea41518/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");
     }
   });
 


Mime
View raw message