Эх сурвалжийг харах

HUE-4008 [core] Expandable and fixed close icon for error popup

Enrico Berti 9 жил өмнө
parent
commit
72ce3f6

+ 22 - 3
desktop/core/src/desktop/static/desktop/css/hue3.css

@@ -1028,13 +1028,32 @@ div.box {
   width: 400px;
   text-align: left;
   z-index: 11000;
-  word-break: break-all;
-  overflow-y: auto;
+  padding-right: 10px;
+}
+
+.jHueNotify .message {
   max-height: 140px;
+  overflow-y: auto;
+  word-break: break-all;
+  width: 380px;
+}
+
+.jHueNotify.expanded {
+  z-index: 11001;
+  top: 20px!important;
+  left: 10px;
+  bottom: 10px;
+  width: auto;
+}
+
+.jHueNotify.expanded .message {
+  max-height: 100%;
+  width: auto;
+  word-break: normal;
 }
 
 .jHueNotify .close {
-  right: -27px;
+  right: 2px;
   opacity: 1;
 }
 

+ 22 - 0
desktop/core/src/desktop/static/desktop/js/jquery.notify.js

@@ -63,18 +63,40 @@
       el.css("top", $(".jHueNotify").last().position().top + $(".jHueNotify").last().outerHeight() + MARGIN);
     }
 
+    var scrollColor = '#f0c36d';
+
     if (_this.options.level == TYPES.ERROR) {
       el.addClass("alert-error");
+      scrollColor = '#b94a48';
     }
     else if (_this.options.level == TYPES.INFO) {
       el.addClass("alert-info");
+      scrollColor = '#338bb8';
     }
     el.find(".message").html("<strong>" + _this.options.message + "</strong>");
 
+    el.find(".message").niceScroll({
+      cursorcolor: scrollColor,
+      cursorborder: '1px solid ' + scrollColor,
+      cursoropacitymin: 0,
+      cursoropacitymax: 0.7,
+      scrollspeed: 100,
+      mousescrollstep: 60,
+      cursorminheight: 20,
+      horizrailenabled: false,
+      zindex: 14000,
+      railoffset: { left: 5 }
+    });
+
     if (_this.options.css != null) {
       el.attr("style", _this.options.css);
     }
 
+    el.on('dblclick', function(){
+      el.toggleClass('expanded');
+      el.find('.message').getNiceScroll().resize();
+    });
+
     if (_this.options.sticky) {
       el.find(".close").click(function () {
         el.fadeOut();

+ 1 - 1
desktop/core/src/desktop/templates/common_header.mako

@@ -684,5 +684,5 @@ if USE_NEW_EDITOR.get():
 
 <div id="jHueNotify" class="alert hide">
     <button class="close">&times;</button>
-    <span class="message"></span>
+    <div class="message"></div>
 </div>