Skip to content
Permalink
Browse files

Add workaround for jqueryui/bootstrap incompatibility

  • Loading branch information...
flack committed May 31, 2019
1 parent 6ba6999 commit b594a853ce556413572de8f8670bc3b340bb4ce7
Showing with 23 additions and 7 deletions.
  1. +23 −7 static/midcom.workflow/workflow.js
@@ -101,8 +101,9 @@ $(document).ready(function() {
// Should be fixed in https://github.com/jquery/jquery-ui/commit/643b80c6070e2eba700a09a5b7b9717ea7551005
.append($(text))
.append(spinner)
.appendTo($('body'))
.dialog(options);
.appendTo($('body'));

make_dialog(dialog, options);
});

$('body').on('click', '[data-dialog="dialog"]', function(event) {
@@ -142,8 +143,8 @@ $(document).ready(function() {
.css('min-width', '300px') // This should be handled by dialog's minWidth option, but that doesn't work with width: "auto"
// Should be fixed in https://github.com/jquery/jquery-ui/commit/643b80c6070e2eba700a09a5b7b9717ea7551005
.append($('<p>' + button.data('dialog-text') + '</p>'))
.appendTo($('body'))
.dialog(options);
.appendTo($('body'));
make_dialog(dialog, options);
});
$('body').on('click', '.midcom-workflow-dialog .ui-dialog-buttonpane .ui-button', function() {
var pane = $(this).closest('.ui-dialog-buttonpane'),
@@ -260,7 +261,22 @@ function create_dialog(control, title, url) {
maximized = false;
}
});
})
.dialog(config)
.dialog("instance").uiDialog.draggable("option", "containment", false);
});
make_dialog(dialog, config);
dialog.dialog("instance").uiDialog.draggable("option", "containment", false);
}

function make_dialog(node, config) {
var backup = false;

if (typeof($.fn.popover) != 'undefined') {
backup = $.button;
$.widget.bridge("button", $.ui.button);
}

node.dialog(config);

if (backup) {
$.button = backup;
}
}

0 comments on commit b594a85

Please sign in to comment.
You can’t perform that action at this time.