浏览代码

Fix double submit when ok button is focused (#333)

jekkos 8 年之前
父节点
当前提交
a3eb50bdfc
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      dist/js/bootstrap-dialog.js
  2. 1 1
      dist/js/bootstrap-dialog.min.js
  3. 1 1
      src/js/bootstrap-dialog.js

+ 1 - 1
dist/js/bootstrap-dialog.js

@@ -1092,7 +1092,7 @@
                 var dialog = event.data.dialog;
                 if (typeof dialog.registeredButtonHotkeys[event.which] !== 'undefined') {
                     var $button = $(dialog.registeredButtonHotkeys[event.which]);
-                    !$button.prop('disabled') && $button.focus().trigger('click');
+                    !$button.prop('disabled') && !$button.is(':focus') && $button.focus().trigger('click');
                 }
             });
 

文件差异内容过多而无法显示
+ 1 - 1
dist/js/bootstrap-dialog.min.js


+ 1 - 1
src/js/bootstrap-dialog.js

@@ -1092,7 +1092,7 @@
                 var dialog = event.data.dialog;
                 if (typeof dialog.registeredButtonHotkeys[event.which] !== 'undefined') {
                     var $button = $(dialog.registeredButtonHotkeys[event.which]);
-                    !$button.prop('disabled') && $button.focus().trigger('click');
+                    !$button.prop('disabled') && !$button.is(':focus') && $button.focus().trigger('click');
                 }
             });