add button to hide recipe's options
This commit is contained in:
parent
c9d9730726
commit
6b76b7004a
@ -83,6 +83,7 @@ class HTMLOperation {
|
|||||||
<div class="recip-icons">
|
<div class="recip-icons">
|
||||||
<i class="material-icons breakpoint" title="Set breakpoint" break="false">pause</i>
|
<i class="material-icons breakpoint" title="Set breakpoint" break="false">pause</i>
|
||||||
<i class="material-icons disable-icon" title="Disable operation" disabled="false">not_interested</i>
|
<i class="material-icons disable-icon" title="Disable operation" disabled="false">not_interested</i>
|
||||||
|
<i class="material-icons hide-options" title="Hide options" hide-opt="false">keyboard_arrow_up</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"> </div>`;
|
<div class="clearfix"> </div>`;
|
||||||
|
|
||||||
|
@ -135,6 +135,7 @@ class Manager {
|
|||||||
// Recipe
|
// Recipe
|
||||||
this.addDynamicListener(".arg:not(select)", "input", this.recipe.ingChange, this.recipe);
|
this.addDynamicListener(".arg:not(select)", "input", this.recipe.ingChange, this.recipe);
|
||||||
this.addDynamicListener(".arg[type=checkbox], .arg[type=radio], select.arg", "change", this.recipe.ingChange, this.recipe);
|
this.addDynamicListener(".arg[type=checkbox], .arg[type=radio], select.arg", "change", this.recipe.ingChange, this.recipe);
|
||||||
|
this.addDynamicListener(".hide-options", "click", this.recipe.hideOptClick, this.recipe);
|
||||||
this.addDynamicListener(".disable-icon", "click", this.recipe.disableClick, this.recipe);
|
this.addDynamicListener(".disable-icon", "click", this.recipe.disableClick, this.recipe);
|
||||||
this.addDynamicListener(".breakpoint", "click", this.recipe.breakpointClick, this.recipe);
|
this.addDynamicListener(".breakpoint", "click", this.recipe.breakpointClick, this.recipe);
|
||||||
this.addDynamicListener("#rec-list li.operation", "dblclick", this.recipe.operationDblclick, this.recipe);
|
this.addDynamicListener("#rec-list li.operation", "dblclick", this.recipe.operationDblclick, this.recipe);
|
||||||
|
@ -214,6 +214,30 @@ class RecipeWaiter {
|
|||||||
window.dispatchEvent(this.manager.statechange);
|
window.dispatchEvent(this.manager.statechange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for hide-opt click events.
|
||||||
|
* Updates the icon status.
|
||||||
|
*
|
||||||
|
* @fires Manager#statechange
|
||||||
|
* @param {event} e
|
||||||
|
*/
|
||||||
|
hideOptClick(e) {
|
||||||
|
const icon = e.target;
|
||||||
|
|
||||||
|
if (icon.getAttribute("hide-opt") === "false") {
|
||||||
|
icon.setAttribute("hide-opt", "true");
|
||||||
|
icon.innerText = "keyboard_arrow_down";
|
||||||
|
icon.classList.add("hide-options-selected");
|
||||||
|
icon.parentNode.previousElementSibling.style.display = "none";
|
||||||
|
} else {
|
||||||
|
icon.setAttribute("hide-opt", "false");
|
||||||
|
icon.innerText = "keyboard_arrow_up";
|
||||||
|
icon.classList.remove("hide-options-selected");
|
||||||
|
icon.parentNode.previousElementSibling.style.display = "grid";
|
||||||
|
}
|
||||||
|
|
||||||
|
window.dispatchEvent(this.manager.statechange);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for disable click events.
|
* Handler for disable click events.
|
||||||
|
Loading…
Reference in New Issue
Block a user