todos about promises

master
km0 3 years ago
parent 1f9d55829e
commit 2245963ab1

@ -94,8 +94,11 @@ function drawLabel() {
let height = maxY - minY; let height = maxY - minY;
if (width > minimumSizeX && height > minimumSizeY) { if (width > minimumSizeX && height > minimumSizeY) {
new Promise(function (resolve, reject) { let userInput = new Promise(function (resolve, reject) {
// TODO: show the modal for text input then if insert and value --> resolve, if cancel --> reject // TODO: show the modal for text input in overlay
// TODO: temp editor freeze before the label is created
// then if the user click insert and there is a value in the input-- > resolve the promise and return the text input to create the label,
// if the user click cancel-- > reject the promise and don't create the label
insert.addEventListener("click", (e) => { insert.addEventListener("click", (e) => {
if (input.value) { if (input.value) {
resolve(input.value); resolve(input.value);

Loading…
Cancel
Save