Browse Source

AMBARI-14244. Textarea with task logs is too wide

Alex Antonenko 9 years ago
parent
commit
2915a9a34b

+ 1 - 0
ambari-web/app/styles/application.less

@@ -1820,6 +1820,7 @@ a:focus {
     display: none;
     resize: none;
     overflow: hidden;
+    box-sizing: border-box;
   }
 
   .task-top-wrap {

+ 1 - 0
ambari-web/app/styles/stack_versions.less

@@ -252,6 +252,7 @@
     textarea {
       width: 100%;
       min-height: 100px;
+      box-sizing: border-box;
     }
   }
   .task-list {

+ 4 - 3
ambari-web/app/views/common/host_progress_popup_body_view.js

@@ -722,13 +722,14 @@ App.HostProgressPopupBodyView = App.TableView.extend({
    * @method createClipBoard
    */
   createClipBoard: function () {
-    var logElement = $(".task-detail-log-maintext");
+    var logElement = $(".task-detail-log-maintext"),
+      logElementRect = logElement[0].getBoundingClientRect();
     $(".task-detail-log-clipboard-wrap").html('<textarea class="task-detail-log-clipboard"></textarea>');
     $(".task-detail-log-clipboard")
       .html("stderr: \n" + $(".stderr").html() + "\n stdout:\n" + $(".stdout").html())
       .css('display', 'block')
-      .width(logElement.width())
-      .height(logElement.height())
+      .width(logElementRect.width)
+      .height(logElementRect.height)
       .select();
 
     logElement.css("display", "none");

+ 4 - 3
ambari-web/app/views/wizard/step9/hostLogPopupBody_view.js

@@ -247,13 +247,14 @@ App.WizardStep9HostLogPopupBodyView = Em.View.extend({
    * @method createClipBoard
    */
   createClipBoard: function () {
-    var log = $(".task-detail-log-maintext");
+    var log = $(".task-detail-log-maintext"),
+      logRect = log[0].getBoundingClientRect();
     $(".task-detail-log-clipboard-wrap").html('<textarea class="task-detail-log-clipboard"></textarea>');
     $(".task-detail-log-clipboard")
       .html("stderr: \n" + $(".stderr").html() + "\n stdout:\n" + $(".stdout").html())
       .css("display", "block")
-      .width(log.width())
-      .height(log.height())
+      .width(logRect.width)
+      .height(logRect.height)
       .select();
     log.css("display", "none")
   },