Resizable bootstrap modals

Resizable bootstrap modals

gbenettgbenett Posts: 14Questions: 5Answers: 0

Editor's bootstrap display option looks and works great, including modals. By default bs modals are fixed size/position, but a little research reveals it should be possible to make them resizable and draggable with the following jQuery UI functions:

$('.modal-content').resizable({
    //alsoResize: ".modal-dialog",
    //minHeight: 150
});
$('.modal-dialog').draggable();

$('#myModal').on('show.bs.modal', function () {
    $(this).find('.modal-body').css({
        'max-height':'100%'
    });
});

Unfortunately this isn't working with Editor. Modals appear, but ignore the above script. Any chance there's a known workaround? Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    Try $.fn.dataTable.Editor.display.bootstrap.node() to get the modal element Editor's Bootstrap display uses. You can then use that to attach the various other libraries you need.

    Regards,
    Allan

  • gbenettgbenett Posts: 14Questions: 5Answers: 0

    Beautiful. The modal is the firstChild of the Bootstrap node. Attaching jQuery widgets to that does the trick. B)

This discussion has been closed.