소스 검색

HUE-5013 [oozie] Avoid splitting draggable actions in two lines

Enrico Berti 9 년 전
부모
커밋
37f0b64a0b
1개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. 21 0
      apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

+ 21 - 0
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -749,6 +749,26 @@ ${ dashboard.import_bindings() }
   $(document).ready(function(){
     renderChangeables();
 
+    function resizeToolbar() {
+      $('.draggable-widget').css('width', '');
+      $('.draggable-widget img').css({
+        'width': '',
+        'height': ''
+      });
+      $('.draggable-widget .draggable-icon').css('fontSize', '');
+      if ($('.card-toolbar').height() > 60) {
+        var width = $('.draggable-widget').width();
+        while ($('.card-toolbar').height() > 60) {
+          width -= 1;
+          $('.draggable-widget').width(width);
+          $('.draggable-widget img').width(width / 2).height(width / 2);
+          $('.draggable-widget .draggable-icon').css('fontSize', width / 2);
+        }
+      }
+    }
+
+    resizeToolbar();
+
     $(document).on("blur", "[validate]", function() {
       validateFields();
     });
@@ -768,6 +788,7 @@ ${ dashboard.import_bindings() }
       window.clearTimeout(resizeTimeout);
       resizeTimeout = window.setTimeout(function () {
         renderChangeables();
+        resizeToolbar();
       }, 200);
     });