diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-26 15:09:14 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-26 15:09:14 +0200 |
commit | e78d4261c296d20c3cebcd7e4e23431c04afa0a9 (patch) | |
tree | 7951171a0cfd9aa0388414a898a55b4b28a5deb7 /tooltip | |
parent | 26c15e08742fd6b4a87c46461c075beaa37c0594 (diff) | |
download | apk_browser-e78d4261c296d20c3cebcd7e4e23431c04afa0a9.tar.bz2 apk_browser-e78d4261c296d20c3cebcd7e4e23431c04afa0a9.tar.xz |
multiple changes
add function: remove all apk nodes
add function: format commit url, add commit title from aggregator if possible and use a tooltip
modified/add apk fields to reflect new apk_tools
Diffstat (limited to 'tooltip')
-rw-r--r-- | tooltip/tooltip.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tooltip/tooltip.js b/tooltip/tooltip.js new file mode 100644 index 0000000..ba7364b --- /dev/null +++ b/tooltip/tooltip.js @@ -0,0 +1,36 @@ +/**
+*
+* simpleTooltip jQuery plugin, by Marius ILIE
+* visit http://dev.mariusilie.net for details
+*
+**/
+(function($){ $.fn.simpletooltip = function(){
+ return this.each(function() {
+ var text = $(this).attr("title");
+ $(this).attr("title", "");
+ if(text != undefined) {
+ $(this).hover(function(e){
+ var tipX = e.pageX + 12;
+ var tipY = e.pageY + 12;
+ $(this).attr("title", "");
+ $("body").append("<div id='simpleTooltip' style='position: absolute; z-index: 100; display: none;'>" + text + "</div>");
+ if($.browser.msie) var tipWidth = $("#simpleTooltip").outerWidth(true)
+ else var tipWidth = $("#simpleTooltip").width()
+ $("#simpleTooltip").width(tipWidth);
+ $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");
+ }, function(){
+ $("#simpleTooltip").remove();
+ $(this).attr("title", text);
+ });
+ $(this).mousemove(function(e){
+ var tipX = e.pageX + 12;
+ var tipY = e.pageY + 12;
+ var tipWidth = $("#simpleTooltip").outerWidth(true);
+ var tipHeight = $("#simpleTooltip").outerHeight(true);
+ if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
+ if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
+ $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");
+ });
+ }
+ });
+}})(jQuery);
\ No newline at end of file |