Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
trigger() {
try {
this.checked = !this.checked;
signal(this, "toggle", this.checked);
} catch (err) {
var w = this.world();
if (w) w.logError(err);
else console.error(err);
}
}
trigger() {
try {
signal(this, "fire");
typeof this.action == "function" && this.action();
} catch (err) {
var w = this.world();
if (w) w.logError(err);
else console.error(err);
}
}
onChange(change) {
super.onChange(change);
let inputChange = change.selector === "replace",
validInput = this.isFocused() && this.textString;
if (this.get('placeholder icon')) this.get('placeholder icon').visible = !!this.textString;
this.active && inputChange && signal(this, "searchInput", this.parseInput());
}
toggle(value) {
const [title] = this.submorphs,
valueControl = this.toggledControl(value),
submorphs = [title, ...(valueControl ? [valueControl] : [])];
signal(this, "update", value && valueControl.value);
if (valueControl) valueControl.opacity = 0;
this.animate({submorphs, duration});
if (valueControl) valueControl.animate({opacity: 1, duration});
}