8d2e7fd0c8
Suppression de l'espace perdu
59 lines
1.7 KiB
JavaScript
59 lines
1.7 KiB
JavaScript
import { Misc } from "./misc.js";
|
|
|
|
/**
|
|
* Extend the base Dialog entity by defining a custom window to perform roll.
|
|
* @extends {Dialog}
|
|
*/
|
|
export class RdDCalendrierEditeur extends Dialog {
|
|
|
|
/* -------------------------------------------- */
|
|
constructor(html, calendrier, calendrierData) {
|
|
let dialogConf = {
|
|
content: html,
|
|
title: "Editeur de date/heure",
|
|
buttons: {
|
|
save: { label: "Enregistrer", callback: html => this.fillData() }
|
|
},
|
|
default: "save"
|
|
};
|
|
let dialogOptions = { classes: ["rdddialog"], width: 400, height: 'fit-content', 'z-index': 99999 }
|
|
super(dialogConf, dialogOptions)
|
|
|
|
this.calendrier = calendrier;
|
|
this.calendrierData = calendrierData;
|
|
}
|
|
|
|
/* -------------------------------------------- */
|
|
fillData( ) {
|
|
this.calendrierData.moisKey = $("#nomMois").val();
|
|
this.calendrierData.heureKey = $("#nomHeure").val();
|
|
this.calendrierData.jourMois = $("#jourMois").val();
|
|
this.calendrierData.minutesRelative = $("#minutesRelative").val();
|
|
|
|
console.log("UPDATE ", this.calendrierData);
|
|
this.calendrier.saveEditeur( this.calendrierData )
|
|
}
|
|
|
|
/* -------------------------------------------- */
|
|
updateData( calendrierData ) {
|
|
this.calendrierData = duplicate(calendrierData);
|
|
}
|
|
|
|
/* -------------------------------------------- */
|
|
activateListeners(html) {
|
|
super.activateListeners(html);
|
|
|
|
let calendrierData = this.calendrierData;
|
|
|
|
$(function () {
|
|
console.log(calendrierData);
|
|
$("#nomMois").val(calendrierData.moisKey);
|
|
$("#nomHeure").val(calendrierData.heureKey);
|
|
$("#jourMois").val(calendrierData.jourMois);
|
|
$("#minutesRelative").val(calendrierData.minutesRelative);
|
|
});
|
|
|
|
}
|
|
|
|
}
|