Skip to content

Commit

Permalink
zen mode removed
Browse files Browse the repository at this point in the history
  • Loading branch information
saliherdemk committed Nov 5, 2024
1 parent ff876a7 commit 81a9ea2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 45 deletions.
11 changes: 0 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ <h3>Grada</h3>
</div>
</div>

<div>
<div id="mlp-zen-mode">
Zen:
<input type="radio" id="zen-true" name="mlp-zen" value="true" />
<label for="zen-true">opened</label>

<input type="radio" id="zen-false" name="mlp-zen" value="false" />
<label for="zen-false">closed</label>
</div>
</div>

<button id="toggle-mlp-props" class="btn btn-cyan" type="button">
Hide Props
</button>
Expand Down
25 changes: 2 additions & 23 deletions js/Draw/MLP/MLPView.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class MlpView extends Playable {
constructor() {
super();
this.zenMode = false;
this.loading = false;
this.loadingText = "";
this.layers = [];
Expand Down Expand Up @@ -106,18 +105,6 @@ class MlpView extends Playable {
}
}

handleSetZenMode(mode) {
mode == "true" ? this.openZenMode() : this.closeZenMode();
}

openZenMode() {
this.zenMode = true;
}

closeZenMode() {
this.zenMode = false;
}

setMode(mode) {
this.mode = mode;
this.origin?.setMode(mode);
Expand Down Expand Up @@ -328,7 +315,7 @@ class MlpView extends Playable {
}

handlePressed() {
if (!this.isLoading() && !this.zenMode) {
if (!this.isLoading()) {
this.getPressables().forEach((p) => p.handlePressed());
}
super.handlePressed();
Expand All @@ -343,7 +330,7 @@ class MlpView extends Playable {

handleDoubleClicked() {
if (this.isLoading()) return;
!this.zenMode && this.getLayerReversed().forEach((l) => l.doubleClicked());
this.getLayerReversed().forEach((l) => l.doubleClicked());

if (this.isInactive() || iManager.isBusy()) {
iManager.handleRelease();
Expand Down Expand Up @@ -433,18 +420,10 @@ class MlpView extends Playable {
executeDrawingCommands(commands);
}

showZen() {
LoadingIndiactor.drawText(this.x, this.y, this.w, this.h, "Zen Mode");
}

draw() {
if (!this.isInactive()) {
this.show();
this.isPropsShown() && this.showProps();
if (this.zenMode) {
this.showZen();
return;
}
this.controlButtons.forEach((btn) => btn.draw());
}
this.inputComponent?.draw();
Expand Down
11 changes: 0 additions & 11 deletions js/Organizers/editMlpOrganizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ class EditMLPOrganizer extends EditOrganizer {
event: "change",
handler: this.handleModeChange,
},
{
id: "mlp-zen-mode",
event: "change",
handler: this.handleZenModeChange,
},
];

events.forEach(({ id, event, handler }) => {
Expand Down Expand Up @@ -112,11 +107,6 @@ class EditMLPOrganizer extends EditOrganizer {
this.getSelected().handleSetMode(selectedRadio.value);
}

handleZenModeChange() {
let selectedRadio = document.querySelector('input[name="mlp-zen"]:checked');
this.getSelected().handleSetZenMode(selectedRadio.value);
}

togglePropVisibility() {
this.selected.togglePropsShown();
this.setPropsBtnText();
Expand Down Expand Up @@ -149,7 +139,6 @@ class EditMLPOrganizer extends EditOrganizer {
setElementProperties(`mlp-batch-size`, { value: selected.batchSize });
setElementProperties("err-function-select", { value: selected.errFunc });
setElementProperties(`mode-${selected.mode}`, { checked: true });
setElementProperties(`zen-${selected.zenMode}`, { checked: true });
this.setPropsBtnText();
}

Expand Down

0 comments on commit 81a9ea2

Please sign in to comment.