mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -59,6 +59,12 @@ kit.PluginManager.register('Tooltip2',function(module, exports, require, global)
|
||||
if(!support.isElement(this.hintNode)){
|
||||
console.warn('Tooltip2: masterNode not valid', this.hintNode);
|
||||
}
|
||||
|
||||
if(!support.getNodeData(this.masterNode, PLUGIN_NAME)){
|
||||
support.setNodeData(this.masterNode, PLUGIN_NAME, this);
|
||||
support.data.set(this.masterNode, PLUGIN_NAME, 'loaded');
|
||||
}
|
||||
|
||||
this.hintNode.remove();
|
||||
this.masterNode.appendChild(this.hintNode);
|
||||
//support.setNodeData(this.masterNode, PLUGIN_NAME, this);
|
||||
@@ -67,7 +73,25 @@ kit.PluginManager.register('Tooltip2',function(module, exports, require, global)
|
||||
this.setContent(this.options.content);
|
||||
}
|
||||
|
||||
this.align = new align.Class(this.hintNode, this.masterNode);
|
||||
var limiter = window;
|
||||
var chain = support.node.getChainOfParentsWithNode(this.masterNode);
|
||||
|
||||
chain.every(function(node, i){
|
||||
if(node === document.body || node.tagName === 'HTML' || node === document){
|
||||
limiter = window;
|
||||
return false;
|
||||
}
|
||||
limiter = node;
|
||||
var style = getComputedStyle(node);
|
||||
var overflowX = style.overflowX;
|
||||
var overflowY = style.overflowY;
|
||||
if(!(overflowX === 'visible' || overflowX === 'auto') || !(overflowY === 'visible' || overflowY === 'auto')){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
this.align = new align.Class(this.hintNode, this.masterNode, limiter);
|
||||
var hint = new userAction.Hint(this.masterNode, this.hintNode);
|
||||
this.viewer = hint.viewer;
|
||||
this.viewer.delayHide = 400;
|
||||
@@ -117,6 +141,12 @@ kit.PluginManager.register('Tooltip2',function(module, exports, require, global)
|
||||
this.__setOffset();
|
||||
this.align.set(this.options.hAlign, this.options.vAlign, this.options.hDirection, this.options.vDirection);
|
||||
}
|
||||
};
|
||||
__proto.show = function(){
|
||||
this.viewer.show();
|
||||
};
|
||||
__proto.hide = function(){
|
||||
|
||||
};
|
||||
/**
|
||||
* @param options {Tooltip2Default}
|
||||
|
||||
Reference in New Issue
Block a user