Dante 10 年之前
父节点
当前提交
4875aaa62e

+ 3 - 2
dist/js/bootstrap-dialog.js

@@ -764,6 +764,7 @@
         createButton: function(button) {
             var $button = $('<button class="btn"></button>');
             $button.prop('id', button.id);
+            $button.data('button', button);
 
             // Icon
             if (typeof button.icon !== 'undefined' && $.trim(button.icon) !== '') {
@@ -791,9 +792,9 @@
             $button.on('click', {dialog: this, $button: $button, button: button}, function(event) {
                 var dialog = event.data.dialog;
                 var $button = event.data.$button;
-                var button = event.data.button;
+                var button = $button.data('button');
                 if (typeof button.action === 'function') {
-                    button.action.call($button, dialog);
+                    button.action.call($button, dialog, event);
                 }
 
                 if (button.autospin) {

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


+ 3 - 2
examples/assets/bootstrap-dialog/js/bootstrap-dialog.js

@@ -764,6 +764,7 @@
         createButton: function(button) {
             var $button = $('<button class="btn"></button>');
             $button.prop('id', button.id);
+            $button.data('button', button);
 
             // Icon
             if (typeof button.icon !== 'undefined' && $.trim(button.icon) !== '') {
@@ -791,9 +792,9 @@
             $button.on('click', {dialog: this, $button: $button, button: button}, function(event) {
                 var dialog = event.data.dialog;
                 var $button = event.data.$button;
-                var button = event.data.button;
+                var button = $button.data('button');
                 if (typeof button.action === 'function') {
-                    button.action.call($button, dialog);
+                    button.action.call($button, dialog, event);
                 }
 
                 if (button.autospin) {

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