X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Flsl.js;h=f7efa52f72236622f57796a2b84a501f4ec95e6e;hb=0753df8cb1a2c3d9bd1a3b36c7d1b71ca529bdd3;hp=92e089763fb138fd5e1528ea56d1f3af90bf75dd;hpb=e9a308496a2aa11f98aa5b63c1fa77cbc89e02fd;p=lsl.git diff --git a/public/javascripts/lsl.js b/public/javascripts/lsl.js index 92e0897..f7efa52 100644 --- a/public/javascripts/lsl.js +++ b/public/javascripts/lsl.js @@ -109,7 +109,10 @@ function edit_list() { autoOpen: true, modal: true, title: 'Edit list', - width: 'max-content', + width: 'min(calc(100% - 2em), 20em)', + close: (ev) => { + $(ev.target).dialog('destroy'); + }, buttons: [ { class: 'btn-delete', @@ -118,10 +121,6 @@ function edit_list() { delete_list(d); }, }, - { - text: 'Cancel', - click: ()=>{ d.dialog('destroy'); }, - }, { icon: 'ui-icon-disk', text: 'OK', @@ -335,7 +334,10 @@ function edit_list_item(li) { autoOpen: true, modal: true, title: 'Edit item', - width: 'max-content', + width: 'min(calc(100% - 2em), 20em)', + close: (ev) => { + $(ev.target).dialog('destroy'); + }, buttons: [ { class: 'btn-delete', @@ -344,10 +346,6 @@ function edit_list_item(li) { delete_list_item(d, li); }, }, - { - text: 'Cancel', - click: ()=>{ d.dialog('destroy'); }, - }, { icon: 'ui-icon-disk', text: 'OK', @@ -449,5 +447,8 @@ $(function(){ }); $('#list-items').on('change', '.list-item-row input[type="checkbox"]', handle_list_item_state_changed); load_lists(); + $('body').on('click', '.ui-widget-overlay', (ev) => { + $(ev.target).siblings('.ui-dialog').find('.ui-dialog-content').dialog('close'); + }); }); })();