cartodb-4.42/lib/assets/javascripts/dashboard/views/organization/organization-user-quota.js
2024-04-06 05:25:13 +00:00

40 lines
983 B
JavaScript

const CoreView = require('backbone/core-view');
const UserQuotaSlider = require('./organization-user-quota-slider');
const UserQuotaSliderInput = require('./organization-user-quota-slider-input');
/* Progress quota bar for organization users */
module.exports = CoreView.extend({
initialize: function () {
this._initBinds();
this._initViews();
},
_initBinds: function () {
this.listenTo(this.model, 'change:quota_in_bytes', this._onQuotaChange);
},
_initViews: function () {
// Quota slider
const userQuotaSlider = new UserQuotaSlider({
el: this.$('.js-userQuotaSlider'),
model: this.model
});
this.addView(userQuotaSlider);
// Quota slider input
const userQuotaSliderInput = new UserQuotaSliderInput({
el: this.$('.js-userQuotaSliderInput'),
model: this.model
});
this.addView(userQuotaSliderInput);
},
_onQuotaChange: function (model, quota) {
this.$('#user_quota').val(quota);
}
});