🐞 fix(modals): fix some resizing

This commit is contained in:
thelastWallE 2021-10-07 13:24:45 +02:00
parent 0b5f86f29f
commit c635bc23f2
3 changed files with 9 additions and 17 deletions

View File

@ -4,7 +4,7 @@
border: 1px solid #aaa; border: 1px solid #aaa;
width: 98%; width: 98%;
text-align: center; text-align: center;
word-break: break-all; word-break: break-word;
margin: auto; margin: auto;
} }
@ -339,10 +339,6 @@ div#settings_plugin_klipper div#macros label.control-label {
padding-top: 2px; padding-top: 2px;
} }
#klipper_graph_dialog {
width: 90%;
}
#klipper_graph_dialog .full-sized-box { #klipper_graph_dialog .full-sized-box {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;

View File

@ -93,6 +93,7 @@ $(function () {
var dialog = $("#klipper_graph_dialog"); var dialog = $("#klipper_graph_dialog");
dialog.modal({ dialog.modal({
show: "true", show: "true",
width: "90%",
minHeight: "500px", minHeight: "500px",
maxHeight: "600px", maxHeight: "600px",
}); });

View File

@ -31,16 +31,12 @@ $(function () {
"cache-control": "no-cache", "cache-control": "no-cache",
}); });
editordialog.on('shown.bs.modal', function () { $(window).on('resize', function() {
editor.focus(); self.klipperViewModel.sleep(200).then(
self.setEditorDivSize(); function () {
$(window).on('resize', function(){ self.setEditorDivSize();
self.klipperViewModel.sleep(200).then( }
function () { );
self.setEditorDivSize();
}
);
});
}); });
self.close_selection = function (index) { self.close_selection = function (index) {
@ -82,7 +78,7 @@ $(function () {
} }
self.addStyleAttribute = function ($element, styleAttribute) { self.addStyleAttribute = function ($element, styleAttribute) {
$element.attr('style', $element.attr('style') + '; ' + styleAttribute); $element.attr('style', styleAttribute);
} }
self.setEditorDivSize = function () { self.setEditorDivSize = function () {
@ -91,7 +87,6 @@ $(function () {
var height = $(window).height() - $('#klipper_editor .modal-header').outerHeight() - $('#klipper_editor .modal-footer').outerHeight() - 118; var height = $(window).height() - $('#klipper_editor .modal-header').outerHeight() - $('#klipper_editor .modal-footer').outerHeight() - 118;
self.addStyleAttribute(klipper_modal_body, 'height: ' + height + 'px !important;'); self.addStyleAttribute(klipper_modal_body, 'height: ' + height + 'px !important;');
//self.addStyleAttribute(klipper_config, 'height: ' + height + 'px !important;');
klipper_config.css('height', height); klipper_config.css('height', height);
if (editor) { if (editor) {
editor.resize(); editor.resize();