@@ -898,7 +898,7 @@ $(function () {
898
898
} ) ;
899
899
900
900
var tagDescriptions = { } ;
901
- $ ( ".tagchip" ) . on ( "mousemove" , function ( ) {
901
+ $ ( ".tagchip" ) . on ( "mouseenter mouseover mousemove" , function ( ) {
902
902
var that = $ ( this ) ;
903
903
var tag = that . text ( ) ;
904
904
if ( tag && $ . trim ( tag ) !== "" ) {
@@ -909,16 +909,32 @@ $(function () {
909
909
data . map ( function ( t ) {
910
910
if ( t . description ) {
911
911
tagDescriptions [ t . tag ] = t . description ;
912
+ showTagTooltip ( that , tagDescriptions [ tag ] ) ;
913
+ that . attr ( "title" , "" ) ;
912
914
}
913
915
} ) ;
914
916
} ) ;
915
917
}
916
- if ( $ . trim ( tagDescriptions [ tag ] ) !== "" && that . attr ( "title" ) !== tagDescriptions [ tag ] ) {
917
- that . attr ( "title" , tagDescriptions [ tag ] ) ;
918
+ if ( $ . trim ( tagDescriptions [ tag ] ) !== "" && that . attr ( "data-tooltip" ) !== tagDescriptions [ tag ] ) {
919
+ that . attr ( "title" , "" ) ;
920
+ showTagTooltip ( that , tagDescriptions [ tag ] ) ;
918
921
}
919
922
}
920
923
} ) ;
921
924
925
+ function showTagTooltip ( that , text ) {
926
+ that . next ( "div.material-tooltip" ) . css ( {
927
+ "opacity" :"1" ,
928
+ "visibility" :"visible" ,
929
+ "left" : that . offset ( ) . left ,
930
+ "top" : that . offset ( ) . top + 40
931
+ } ) . find ( ".tooltip-content" ) . text ( text ) ;
932
+ }
933
+
934
+ $ ( ".tagchip" ) . on ( "mouseleave" , function ( ) {
935
+ $ ( this ) . next ( "div.material-tooltip" ) . css ( { "opacity" : "0" , "visibility" : "hidden" } ) ;
936
+ } ) ;
937
+
922
938
/****************************************************
923
939
* PAGINATION
924
940
****************************************************/
0 commit comments