ソースを参照

Merge pull request #347 from jekkos/master

Fix double submit when ok button is focused (#333)
Dante 8 年 前
コミット
6f4adfd302

+ 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');
                 }
             });