laravel-jstools
Version:
JS tools for building front-side of Laravel applications
40 lines (39 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Page_1 = require("../../../../../services/PageService/Page");
class Omx_Resource_User_Show extends Page_1.Page {
init() {
window.initHistoryTab(this.pageId, this.getDefaultTableModelHistoryId('User'), {
searching: false,
lengthChange: false,
});
window.form(`${this.pageId}__formAttachRole`);
window.form(`${this.pageId}__formChangePass`);
const tableUserRolesId = `${this.pageId}__TableUserRoles`;
const deleteRoleUrl = $(`#${this.pageId}__TableUserRoles_urlRowDelete`).val();
$(`#${tableUserRolesId}`).on('click', '.js-row-delete', function () {
const $button = $(this);
const rowId = $button.data('rowId');
const $row = $button.parent().parent();
const callbackList = {
start: () => {
$button.hide();
},
finish: () => {
$button.show();
},
success: () => {
$row.empty();
},
};
window.App.make('a').send({
url: deleteRoleUrl,
method: 'DELETE',
data: {
role_id: rowId,
},
}, callbackList);
});
}
}
exports.default = Omx_Resource_User_Show;