mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +03:00
es5 -> es2015 (last stage)
Signature plugin fixes Add view decorator A large number of fixes
This commit is contained in:
parent
e88c193334
commit
17669b7be0
153 changed files with 21193 additions and 21115 deletions
|
|
@ -1,35 +1,32 @@
|
|||
|
||||
var
|
||||
window = require('window'),
|
||||
ko = require('ko');
|
||||
import window from 'window';
|
||||
import ko from 'ko';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function QuotaUserStore()
|
||||
class QuotaUserStore
|
||||
{
|
||||
this.quota = ko.observable(0);
|
||||
this.usage = ko.observable(0);
|
||||
constructor() {
|
||||
this.quota = ko.observable(0);
|
||||
this.usage = ko.observable(0);
|
||||
|
||||
this.percentage = ko.computed(function() {
|
||||
this.percentage = ko.computed(() => {
|
||||
|
||||
var
|
||||
iQuota = this.quota(),
|
||||
iUsed = this.usage();
|
||||
const
|
||||
quota = this.quota(),
|
||||
usage = this.usage();
|
||||
|
||||
return 0 < iQuota ? window.Math.ceil((iUsed / iQuota) * 100) : 0;
|
||||
return 0 < quota ? window.Math.ceil((usage / quota) * 100) : 0;
|
||||
|
||||
}, this);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} quota
|
||||
* @param {number} usage
|
||||
*/
|
||||
populateData(quota, usage) {
|
||||
this.quota(quota * 1024);
|
||||
this.usage(usage * 1024);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} iQuota
|
||||
* @param {number} iUsage
|
||||
*/
|
||||
QuotaUserStore.prototype.populateData = function(iQuota, iUsage)
|
||||
{
|
||||
this.quota(iQuota * 1024);
|
||||
this.usage(iUsage * 1024);
|
||||
};
|
||||
|
||||
module.exports = new QuotaUserStore();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue