From c635bc23f29406e58637d5590d34264362c903a2 Mon Sep 17 00:00:00 2001 From: thelastWallE <12502210+thelastWallE@users.noreply.github.com> Date: Thu, 7 Oct 2021 13:24:45 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(modals):=20fix=20some=20resi?= =?UTF-8?q?zing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- octoprint_klipper/static/css/klipper.css | 6 +----- octoprint_klipper/static/js/klipper.js | 1 + octoprint_klipper/static/js/klipper_editor.js | 19 +++++++------------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/octoprint_klipper/static/css/klipper.css b/octoprint_klipper/static/css/klipper.css index db2780f..8e55e11 100644 --- a/octoprint_klipper/static/css/klipper.css +++ b/octoprint_klipper/static/css/klipper.css @@ -4,7 +4,7 @@ border: 1px solid #aaa; width: 98%; text-align: center; - word-break: break-all; + word-break: break-word; margin: auto; } @@ -339,10 +339,6 @@ div#settings_plugin_klipper div#macros label.control-label { padding-top: 2px; } -#klipper_graph_dialog { - width: 90%; -} - #klipper_graph_dialog .full-sized-box { width: 100%; margin: 0 auto; diff --git a/octoprint_klipper/static/js/klipper.js b/octoprint_klipper/static/js/klipper.js index a608dd6..cb8dc43 100644 --- a/octoprint_klipper/static/js/klipper.js +++ b/octoprint_klipper/static/js/klipper.js @@ -93,6 +93,7 @@ $(function () { var dialog = $("#klipper_graph_dialog"); dialog.modal({ show: "true", + width: "90%", minHeight: "500px", maxHeight: "600px", }); diff --git a/octoprint_klipper/static/js/klipper_editor.js b/octoprint_klipper/static/js/klipper_editor.js index e4a6798..d09c632 100644 --- a/octoprint_klipper/static/js/klipper_editor.js +++ b/octoprint_klipper/static/js/klipper_editor.js @@ -31,16 +31,12 @@ $(function () { "cache-control": "no-cache", }); - editordialog.on('shown.bs.modal', function () { - editor.focus(); - self.setEditorDivSize(); - $(window).on('resize', function(){ - self.klipperViewModel.sleep(200).then( - function () { - self.setEditorDivSize(); - } - ); - }); + $(window).on('resize', function() { + self.klipperViewModel.sleep(200).then( + function () { + self.setEditorDivSize(); + } + ); }); self.close_selection = function (index) { @@ -82,7 +78,7 @@ $(function () { } self.addStyleAttribute = function ($element, styleAttribute) { - $element.attr('style', $element.attr('style') + '; ' + styleAttribute); + $element.attr('style', styleAttribute); } self.setEditorDivSize = function () { @@ -91,7 +87,6 @@ $(function () { 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_config, 'height: ' + height + 'px !important;'); klipper_config.css('height', height); if (editor) { editor.resize();