[FIX] Disable tooltip when clicking on action buttons
bzr revid: fme@openerp.com-20111207113559-128r2hkg4x62in2i
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
--- jquery.tipTip_old.js 2011-11-14 21:40:55.000000000 +0100
|
||||
+++ jquery.tipTip.js 2011-11-15 10:09:35.000000000 +0100
|
||||
@@ -31,7 +31,7 @@
|
||||
--- jquery.tipTip_old.js 2011-12-01 14:15:35.000000000 +0100
|
||||
+++ jquery.tipTip.js 2011-12-07 12:32:32.000000000 +0100
|
||||
@@ -20,6 +20,9 @@
|
||||
*/
|
||||
|
||||
(function($){
|
||||
+ $.tipTipClear = function() {
|
||||
+ $("#tiptip_holder").remove();
|
||||
+ }
|
||||
$.fn.tipTip = function(options) {
|
||||
var defaults = {
|
||||
activation: "hover",
|
||||
@@ -31,7 +34,7 @@
|
||||
fadeIn: 200,
|
||||
fadeOut: 200,
|
||||
attribute: "title",
|
||||
@@ -9,7 +19,7 @@
|
||||
enter: function(){},
|
||||
exit: function(){}
|
||||
};
|
||||
@@ -51,12 +51,7 @@
|
||||
@@ -51,12 +54,7 @@
|
||||
|
||||
return this.each(function(){
|
||||
var org_elem = $(this);
|
||||
@@ -23,24 +33,20 @@
|
||||
if(!opts.content){
|
||||
org_elem.removeAttr(opts.attribute); //remove original Attribute
|
||||
}
|
||||
@@ -99,6 +94,8 @@
|
||||
@@ -99,6 +97,8 @@
|
||||
|
||||
function active_tiptip(){
|
||||
opts.enter.call(this);
|
||||
+ var org_title = typeof opts.content === 'function' ? opts.content() : opts.content;
|
||||
+ var org_title = typeof opts.content === 'function' ? opts.content.call(org_elem, opts) : opts.content;
|
||||
+ org_title = org_title || org_elem.attr(opts.attribute);
|
||||
tiptip_content.html(org_title);
|
||||
tiptip_holder.hide().removeAttr("class").css("margin","0");
|
||||
tiptip_arrow.removeAttr("style");
|
||||
@@ -176,8 +173,15 @@
|
||||
tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": arrow_top+"px"});
|
||||
@@ -177,7 +177,12 @@
|
||||
tiptip_holder.css({"margin-left": marg_left+"px", "margin-top": marg_top+"px"}).attr("class","tip"+t_class);
|
||||
|
||||
- if (timeout){ clearTimeout(timeout); }
|
||||
if (timeout){ clearTimeout(timeout); }
|
||||
- timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay);
|
||||
+ if (timeout) {
|
||||
+ clearTimeout(timeout);
|
||||
+ }
|
||||
+ timeout = setTimeout(function() {
|
||||
+ tiptip_holder.stop(true,true);
|
||||
+ if ($.contains(document.documentElement, org_elem[0])) {
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
*/
|
||||
|
||||
(function($){
|
||||
$.tipTipClear = function() {
|
||||
$("#tiptip_holder").remove();
|
||||
}
|
||||
$.fn.tipTip = function(options) {
|
||||
var defaults = {
|
||||
activation: "hover",
|
||||
|
||||
@@ -1043,6 +1043,7 @@ openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({
|
||||
this.execute_action().always(function() {
|
||||
self.force_disabled = false;
|
||||
self.check_disable();
|
||||
$.tipTipClear();
|
||||
});
|
||||
},
|
||||
execute_action: function() {
|
||||
|
||||
Reference in New Issue
Block a user