@@ -57,6 +57,14 @@ function autoscale(value) {
5757 return ((Math.round(scale*data)/scale)+' '+unit[base]).replace('.','<?=$display['number'][0]?>')+'/s';
5858}
5959
60+ function preventFileTreeClose() {
61+ // Prevent fileTree dropdown from closing when clicking inside the dialog
62+ // by stopping mousedown events from bubbling to the document handler
63+ $('.ui-dfm').off('mousedown.dfmFileTree').on('mousedown.dfmFileTree', function(e) {
64+ e.stopPropagation();
65+ });
66+ }
67+
6068function folderContextMenu(id, button) {
6169 var opts = [];
6270 context.settings({button:button});
@@ -482,6 +490,9 @@ function doAction(action, title, id) {
482490 resizable: false,
483491 draggable: false,
484492 modal: true,
493+ close: function() {
494+ $('.ui-dfm').off('mousedown.dfmFileTree');
495+ },
485496 buttons: {
486497 "_(Start)_": function(){
487498 if (dfm.running) return;
@@ -592,6 +603,7 @@ function doAction(action, title, id) {
592603 }
593604 });
594605 dfm_close_button();
606+ preventFileTreeClose();
595607 if (action == 15) $('.ui-dfm .ui-dialog-buttonset button:eq(1)').prop('disabled',true);
596608 setTimeout(function(){if (dfm.window.find('#dfm_target').length) dfm.window.find('#dfm_target').focus().click(); else $('.ui-dfm .ui-dialog-buttonset button:eq(0)').focus();});
597609}
@@ -749,6 +761,9 @@ function doActions(action, title) {
749761 resizable: false,
750762 draggable: false,
751763 modal: true,
764+ close: function() {
765+ $('.ui-dfm').off('mousedown.dfmFileTree');
766+ },
752767 buttons: {
753768 "_(Start)_": function(){
754769 if (dfm.running) return;
@@ -862,6 +877,7 @@ function doActions(action, title) {
862877 }
863878 });
864879 dfm_close_button();
880+ preventFileTreeClose();
865881 if (action == 15) $('.ui-dfm .ui-dialog-buttonset button:eq(1)').prop('disabled',true);
866882 setTimeout(function(){if (dfm.window.find('#dfm_target').length) dfm.window.find('#dfm_target').focus().click(); else $('.ui-dfm .ui-dialog-buttonset button:eq(0)').focus();});
867883}
0 commit comments