Browse Source

Merge pull request #308 from zeckdude/bootstrap-dialog-button-data-attributes

Add support for data attributes on buttons
Dante 9 years ago
parent
commit
619972299a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/js/bootstrap-dialog.js

+ 7 - 0
src/js/bootstrap-dialog.js

@@ -844,6 +844,13 @@
                 $button.addClass('btn-default');
             }
 
+            // Data attributes
+            if (typeof button.data === 'object' && button.data.constructor === {}.constructor) {
+                $.each(button.data, function (key, value) {
+                    $button.attr('data-'+key, value);
+                });
+            }
+
             // Hotkey
             if (typeof button.hotkey !== 'undefined') {
                 this.registeredButtonHotkeys[button.hotkey] = $button;