Files
safekat/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js
2025-03-05 00:51:14 +01:00

109 lines
3.3 KiB
JavaScript

import preview from '../../../components/preview.js';
class PreviewFormasAdmin {
constructor(tipoLibro, tipoTapa, data) {
this.data = data;
this.isCosido = $("#isCosido").val();
this.tipoTapa = tipoTapa;
// Container para el esquema de cubierta
this.preview = new preview($('#pv_ec_shape'), tipoLibro, tipoTapa, "fullImage", data);
}
setData(data) {
this.data = data;
}
init() {
const self = this;
this.preview.resizeEvent();
// $(".refresh-shape").on("click", () => {
// $("#accordionPreviewTip").find(".nav-link.active").each((index, element) => {
// this.preview.setViewBoxToPreview()
// })
// })
$('#tab-pv-bn').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('bn', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-bnhq').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('bnhq', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-color').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('color', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-colorhq').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('colorhq', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-rot-bn').on("click", function () {
self.preview.setData(self.data);
self.preview.previewRotativa('rot_bn', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-rot-color').on("click", function () {
self.preview.setData(self.data);
self.preview.previewRotativa('rot_color', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-guardas').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('guardas', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-cubierta').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('cubierta', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-esquema-cubierta').on("click", function () {
self.preview.setData(self.data);
self.preview.getObjetoLP('ec', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
self.preview.previewEsquemaCubierta('ec', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-sobrecubierta').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('sobrecubierta', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
$('#tab-pv-faja').on("click", function () {
self.preview.setData(self.data);
self.preview.previewInteriorPlana('faja', self.isCosido, self.tipoTapa.includes("dura") ? 1 : 0);
});
}
}
export default PreviewFormasAdmin;