Skip to content

Commit

Permalink
Add workaround for jqueryui/bootstrap incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed May 31, 2019
1 parent 6ba6999 commit b594a85
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions static/midcom.workflow/workflow.js
Expand Up @@ -101,8 +101,9 @@ $(document).ready(function() {
// Should be fixed in https://github.com/jquery/jquery-ui/commit/643b80c6070e2eba700a09a5b7b9717ea7551005 // Should be fixed in https://github.com/jquery/jquery-ui/commit/643b80c6070e2eba700a09a5b7b9717ea7551005
.append($(text)) .append($(text))
.append(spinner) .append(spinner)
.appendTo($('body')) .appendTo($('body'));
.dialog(options);
make_dialog(dialog, options);
}); });


$('body').on('click', '[data-dialog="dialog"]', function(event) { $('body').on('click', '[data-dialog="dialog"]', function(event) {
Expand Down Expand Up @@ -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" .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 // Should be fixed in https://github.com/jquery/jquery-ui/commit/643b80c6070e2eba700a09a5b7b9717ea7551005
.append($('<p>' + button.data('dialog-text') + '</p>')) .append($('<p>' + button.data('dialog-text') + '</p>'))
.appendTo($('body')) .appendTo($('body'));
.dialog(options); make_dialog(dialog, options);
}); });
$('body').on('click', '.midcom-workflow-dialog .ui-dialog-buttonpane .ui-button', function() { $('body').on('click', '.midcom-workflow-dialog .ui-dialog-buttonpane .ui-button', function() {
var pane = $(this).closest('.ui-dialog-buttonpane'), var pane = $(this).closest('.ui-dialog-buttonpane'),
Expand Down Expand Up @@ -260,7 +261,22 @@ function create_dialog(control, title, url) {
maximized = false; maximized = false;
} }
}); });
}) });
.dialog(config) make_dialog(dialog, config);
.dialog("instance").uiDialog.draggable("option", "containment", false); 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.