diff --git a/src/main/resources/static/scripts/scoold.js b/src/main/resources/static/scripts/scoold.js index b738affd..296998bb 100755 --- a/src/main/resources/static/scripts/scoold.js +++ b/src/main/resources/static/scripts/scoold.js @@ -898,7 +898,7 @@ $(function () { }); var tagDescriptions = {}; - $(".tagchip").on("mousemove", function () { + $(".tagchip").on("mouseenter mouseover mousemove", function () { var that = $(this); var tag = that.text(); if (tag && $.trim(tag) !== "") { @@ -909,16 +909,32 @@ $(function () { data.map(function (t) { if (t.description) { tagDescriptions[t.tag] = t.description; + showTagTooltip(that, tagDescriptions[tag]); + that.attr("title", ""); } }); }); } - if ($.trim(tagDescriptions[tag]) !== "" && that.attr("title") !== tagDescriptions[tag]) { - that.attr("title", tagDescriptions[tag]); + if ($.trim(tagDescriptions[tag]) !== "" && that.attr("data-tooltip") !== tagDescriptions[tag]) { + that.attr("title", ""); + showTagTooltip(that, tagDescriptions[tag]); } } }); + function showTagTooltip(that, text) { + that.next("div.material-tooltip").css({ + "opacity":"1", + "visibility":"visible", + "left": that.offset().left, + "top": that.offset().top + 40 + }).find(".tooltip-content").text(text); + } + + $(".tagchip").on("mouseleave", function () { + $(this).next("div.material-tooltip").css({"opacity": "0", "visibility": "hidden"}); + }); + /**************************************************** * PAGINATION ****************************************************/ diff --git a/src/main/resources/templates/macro.vm b/src/main/resources/templates/macro.vm index 9ce33aa7..9de819fe 100755 --- a/src/main/resources/templates/macro.vm +++ b/src/main/resources/templates/macro.vm @@ -257,6 +257,7 @@ $!showtag #else $!showtag +
#end #end #end