mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 09:23:48 +01:00
wip
This commit is contained in:
parent
2f2234f50c
commit
a64632bba5
@ -133,29 +133,35 @@
|
|||||||
this.text.focus();
|
this.text.focus();
|
||||||
|
|
||||||
this.refs.window.on('closing', () => {
|
this.refs.window.on('closing', () => {
|
||||||
if @done
|
if (this.done) {
|
||||||
this.opts.on-ok @text.value
|
this.opts.onOk(this.text.value);
|
||||||
else
|
} else {
|
||||||
if this.opts.on-cancel?
|
if (this.opts.onCancel) this.opts.onCancel();
|
||||||
this.opts.on-cancel!
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.refs.window.on('closed', () => {
|
this.refs.window.on('closed', () => {
|
||||||
this.unmount();
|
this.unmount();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
this.cancel = () => {
|
this.cancel = () => {
|
||||||
this.done = false
|
this.done = false;
|
||||||
this.refs.window.close();
|
this.refs.window.close();
|
||||||
|
};
|
||||||
|
|
||||||
this.ok = () => {
|
this.ok = () => {
|
||||||
if not @allow-empty and @text.value == '' then return
|
if (!this.allowEmpty && this.text.value == '') return;
|
||||||
this.done = true
|
this.done = true;
|
||||||
this.refs.window.close();
|
this.refs.window.close();
|
||||||
|
};
|
||||||
|
|
||||||
this.onKeydown = (e) => {
|
this.onKeydown = e => {
|
||||||
if e.which == 13 // Enter
|
if (e.which == 13) { // Enter
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@ok!
|
this.ok();
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
</mk-input-dialog>
|
</mk-input-dialog>
|
||||||
|
@ -16,5 +16,7 @@
|
|||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.refs.tl.on('loaded', () => {
|
this.refs.tl.on('loaded', () => {
|
||||||
this.trigger('loaded');
|
this.trigger('loaded');
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</mk-home>
|
</mk-home>
|
||||||
|
Loading…
Reference in New Issue
Block a user