浏览代码

[notebook] Support two lines in magic wheel alternatives

Johan Ahlen 10 年之前
父节点
当前提交
a24e154

+ 5 - 2
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -232,8 +232,7 @@ ko.bindingHandlers.radialMenu = {
         var iconRadius = $element.find("i").width() / 2;
 
         $.each(alternatives(), function (index, alternative) {
-          $("<div>")
-            .text(textRenderer(alternative))
+          var outerDiv = $("<div>")
             .addClass(alternativeCss)
             .css("left", radius * Math.cos(currentRad) + iconRadius)
             .css("top", radius * Math.sin(currentRad) + iconRadius)
@@ -245,6 +244,10 @@ ko.bindingHandlers.radialMenu = {
             })
             .on("mouseleave", hideAlternatives)
             .appendTo(allAlternatives);
+          $("<div>")
+            .text(textRenderer(alternative))
+            .appendTo(outerDiv);
+
           currentRad += radIncrements;
         });
         $element.append(allAlternatives);

+ 9 - 2
desktop/libs/notebook/src/notebook/static/notebook/css/notebook.css

@@ -156,12 +156,19 @@ body {
   position: absolute;
   background-color: #61abd1;
   color: #DBE8F1;
-  font-size: 11px;
-  line-height: 50px;
   height: 50px;
   width: 50px;
   border-radius: 25px;
+}
+
+.add-snippet-alt > div {
+  display: table-cell;
   text-align: center;
+  vertical-align: middle;
+  line-height: 15px;
+  width: 50px;
+  height: 50px;
+  font-size: 11px;
 }
 
 .add-last-used-snippet,