cartodb-4.42/lib/assets/javascripts/dashboard/views/mobile-apps/delete-mobile-app/delete-mobile-app-view.js
2024-04-06 05:25:13 +00:00

38 lines
895 B
JavaScript

const CoreView = require('backbone/core-view');
const template = require('./delete-mobile-app.tpl');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const REQUIRED_OPTS = [
'modalModel',
'configModel',
'authenticityToken',
'needsPasswordConfirmation'
];
module.exports = CoreView.extend({
events: {
'submit .js-form': '_close',
'click .js-cancel': '_close'
},
initialize: function (options) {
checkAndBuildOpts(options, REQUIRED_OPTS, this);
},
render: function () {
const mobileAppId = this.options.mobileApp.id;
this.$el.html(
template({
formAction: `${this._configModel.get('base_url')}/your_apps/mobile/${mobileAppId}`,
authenticityToken: this._authenticityToken,
passwordNeeded: this._needsPasswordConfirmation
})
);
},
_close: function () {
this._modalModel.destroy();
}
});