EditAssetForm: replace widget class with generic content box

This commit is contained in:
2023-03-11 14:31:44 +01:00
parent a6fd8d2764
commit 5bb8c020bd
4 changed files with 27 additions and 45 deletions

View File

@@ -3,7 +3,7 @@ class CropEditor {
this.opt = opt;
this.edit_crop_button = document.createElement("span");
this.edit_crop_button.className = "btn";
this.edit_crop_button.className = "btn btn-light";
this.edit_crop_button.textContent = "Edit crop";
this.edit_crop_button.addEventListener('click', this.show.bind(this));
@@ -34,6 +34,7 @@ class CropEditor {
this.position.appendChild(source_x_label);
this.source_x = document.createElement("input");
this.source_x.className = 'form-control d-inline';
this.source_x.type = 'number';
this.source_x.addEventListener("change", this.positionBoundary.bind(this));
this.source_x.addEventListener("keyup", this.positionBoundary.bind(this));
@@ -43,6 +44,7 @@ class CropEditor {
this.position.appendChild(source_y_label);
this.source_y = document.createElement("input");
this.source_y.className = 'form-control d-inline';
this.source_y.type = 'number';
this.source_y.addEventListener("change", this.positionBoundary.bind(this));
this.source_y.addEventListener("keyup", this.positionBoundary.bind(this));
@@ -52,6 +54,7 @@ class CropEditor {
this.position.appendChild(crop_width_label);
this.crop_width = document.createElement("input");
this.crop_width.className = 'form-control d-inline';
this.crop_width.type = 'number';
this.crop_width.addEventListener("change", this.positionBoundary.bind(this));
this.crop_width.addEventListener("keyup", this.positionBoundary.bind(this));
@@ -61,6 +64,7 @@ class CropEditor {
this.position.appendChild(crop_height_label);
this.crop_height = document.createElement("input");
this.crop_height.className = 'form-control d-inline';
this.crop_height.type = 'number';
this.crop_height.addEventListener("change", this.positionBoundary.bind(this));
this.crop_height.addEventListener("keyup", this.positionBoundary.bind(this));
@@ -78,13 +82,13 @@ class CropEditor {
this.crop_constrain_label.appendChild(this.crop_constrain_text);
this.save_button = document.createElement("span");
this.save_button.className = "btn";
this.save_button.className = "btn btn-light";
this.save_button.textContent = "Save";
this.save_button.addEventListener('click', this.save.bind(this));
this.position.appendChild(this.save_button);
this.abort_button = document.createElement("span");
this.abort_button.className = "btn btn-red";
this.abort_button.className = "btn btn-danger";
this.abort_button.textContent = "Abort";
this.abort_button.addEventListener('click', this.hide.bind(this));
this.position.appendChild(this.abort_button);