Reputation: 147
I am having a requirement of minimizing and maximizing the uib-modal, please suggest me ways to do so.
Upvotes: 4
Views: 2628
Reputation: 147
I did not find any way to do so, so I created my own js and css to give a feel like minmize and maximize, I have used jquery for this.
SCRIPT
$("body").on("click", ".toggle-popup", function () {
$(".modal-backdrop").hide();
$(this).closest(".modal").toggleClass("minimize");
$(this).find("i").addClass("fa-window-maximize");
$(this).find("i").removeClass("fa-window-minimize");
$("body").removeClass("modal-open");
})
$("body").on("click", ".minimize .toggle-popup", function () {
$(".modal-backdrop").show();
$(this).find("i").removeClass("fa-window-maximize");
$(this).find("i").addClass("fa-window-minimize");
$("body").addClass("modal-open");
})
CSS
<style type="text/css">
.modal.minimize{
position: fixed;
top: auto;
right: auto;
bottom: 10px;
left: 10px;
}
.modal.minimize .modal-body, .modal.minimize .modal-footer{
display: none;
}
.modal.minimize .modal-dialog{
margin: 0;
width: 200px;
}
.modal.minimize .modal-dialog .modal-header{
padding: 5px;
background-color: #EEE;
}
.modal.minimize .modal-dialog .modal-header h3{
font-size: 16px;
}
</style>
Upvotes: 1