Permalink
Browse files

Change behaviour of initialize tooltips on ajax calls

  • Loading branch information...
1 parent 3be49a0 commit 43b2561bee20ea5685ca6e6a6fc9eebcdc21e936 @maethu maethu committed Jan 14, 2013
Showing with 9 additions and 5 deletions.
  1. +2 −0 docs/HISTORY.txt
  2. +7 −5 ftw/tooltip/browser/tooltip_template.js.pt
View
@@ -4,6 +4,8 @@ Changelog
1.1.1 (unreleased)
------------------
+- Change behaviour of initialize tooltips on ajax calls.
+
- onegov.ch approved: add badge to readme.
[jone]
@@ -4,7 +4,6 @@ var ftwtooltips = <span tal:replace="ftwtooltips" />;
function ShowTooltip(item){
$(item.selector).live('mouseover', function(e){
-
e.preventDefault();
var $this = $(this);
if (item.text){
@@ -24,19 +23,22 @@ function ShowTooltip(item){
var customconfig = <span tal:replace="structure view/get_custom_config" />;
var settings = $.extend({
tipClass:'',
- delay:0,
+ predelay:200,
cancelDefault: true,
layout: "<span tal:replace="structure view/get_tooltip_layout" />",
events: {
def: "mouseenter,mouseleave mousedown",
tooltip: 'mouseleave'
}
}, customconfig);
-
- $this.tooltip(settings);
+ if (!$this.data('tooltip')){
+ $this.tooltip(settings);
+ $this.trigger('mouseover')
+ }
// Manually remove title attribute (live event allways readds the title attr)
$this.attr('title', '');
- $this.trigger('mouseover')
+
+ //$this.data('tooltip').show()
}
});
}

0 comments on commit 43b2561

Please sign in to comment.