diff --git a/js/misc/dialog.ajax.js b/js/misc/dialog.ajax.js
index b12c7e9..ed124f7 100644
--- a/js/misc/dialog.ajax.js
+++ b/js/misc/dialog.ajax.js
@@ -134,8 +134,17 @@
 
     // Bind dialogButtonsChange.
     $dialog.on('dialogButtonsChange', function () {
+      // Clear out the footer.
+      var $footer = $dialog.find('.modal-footer').empty();
       var buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog);
-      $dialog.modal('option', 'buttons', buttons);
+
+      // Insert new buttons into the footer.
+      $.each(buttons, function(i, button) {
+        console.log(button);
+        $('<button class="' + button.class + '">' + button.text + '</button>')
+          .appendTo($footer)
+          .on('click', button.click);
+      });
     });
 
     // Open the dialog itself.
