Explorar el Código

Stag popup update ESC handling

Vijayakrishnan hace 3 años
padre
commit
c200a01bf8
Se han modificado 2 ficheros con 9 adiciones y 4 borrados
  1. 1 1
      public/js/stag-popup.js
  2. 8 3
      public/js/stag-table-filter.js

+ 1 - 1
public/js/stag-popup.js

@@ -230,7 +230,7 @@ function hasResponseError(_data) {
                 if(e.which === 27) {
                     if(!isEventConsumed(e)) {
                         if(stagPopupsQueue.length) {
-                            if($('.stag-popup.show [moe] [url]:visible').length || $('.stag-popup.show [visit-moe] [url]:visible').length) {
+                            if($('.stag-popup.show [moe] [url]:not([show]):visible').length || $('.stag-popup.show [visit-moe] [url]:not([show]):visible').length) {
                                 return;
                             }
                             closeStagPopup();

+ 8 - 3
public/js/stag-table-filter.js

@@ -51,9 +51,14 @@
             .off('keyup.stag-table-filter')
             .on('keyup.stag-table-filter', 'input[stag-table-filter]', function(_e) {
                 if(_e.which === 27) {
-                    $(this).val('');
-                    applyFilter($(this));
-                    return false;
+                    if(!isEventConsumed(e)) {
+                        if ($(this).val() !== '') {
+                            $(this).val('');
+                            applyFilter($(this));
+                            markEventAsConsumed(_e);
+                            return false;
+                        }
+                    }
                 }
             })
     }