From fcfd71f2554f58e8de481ab59fb240e5961884a9 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 27 Jun 2017 16:39:48 -0700 Subject: [PATCH] making host event modal resizable and draggable --- .../src/job-results/host-event/host-event.block.less | 1 - .../src/job-results/host-event/host-event.controller.js | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/job-results/host-event/host-event.block.less b/awx/ui/client/src/job-results/host-event/host-event.block.less index e99482cb27..3fcbd35655 100644 --- a/awx/ui/client/src/job-results/host-event/host-event.block.less +++ b/awx/ui/client/src/job-results/host-event/host-event.block.less @@ -99,7 +99,6 @@ margin-bottom: 8px; } .HostEvent .modal-body{ - max-height: 600px; padding: 0px!important; overflow-y: auto; } diff --git a/awx/ui/client/src/job-results/host-event/host-event.controller.js b/awx/ui/client/src/job-results/host-event/host-event.controller.js index 825cb5e25a..e09e33740a 100644 --- a/awx/ui/client/src/job-results/host-event/host-event.controller.js +++ b/awx/ui/client/src/job-results/host-event/host-event.controller.js @@ -24,6 +24,10 @@ }); editor.setSize("100%", 200); editor.getDoc().setValue(data); + $('.modal-dialog').on('resize', function(){ + let height = $('.modal-dialog').height() - $('.HostEvent-header').height() - $('.HostEvent-details').height() - $('.HostEvent-nav').height() - $('.HostEvent-controls').height() - 120; + editor.setSize("100%", height); + }); }; /*ignore jslint end*/ $scope.isActiveState = function(name){ @@ -96,6 +100,11 @@ } } $('#HostEvent').modal('show'); + $('.modal-content').resizable({ + minHeight: 450, + minWidth: 600 + }); + $('.modal-dialog').draggable(); $('#HostEvent').on('hidden.bs.modal', function () { $scope.closeHostEvent();