ソースを参照

Merge pull request #7 from AndrewEastwood/patch-1

Button hotkey supported.
nakupanda 12 年 前
コミット
d0757cf447
1 ファイル変更9 行追加0 行削除
  1. 9 0
      js/bootstrap-dialog.js

+ 9 - 0
js/bootstrap-dialog.js

@@ -432,6 +432,15 @@ var BootstrapDialog = null;
                 }
             });
 
+            // Button hotKey
+            if (button.hotKey)
+                this.getModalDialog().on('keypress', function(event){
+                    if (!event || !event.which)
+                        return;
+                    if (event.which === button.hotKey)
+                        $button.trigger('click');
+                });
+
             return $button;
         },
         /**