Current Path :
/
home
/
zrcdevco
/
public_html
/
zrcprod
/
media
/
tooltips
/
js
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/zrcdevco/public_html/zrcprod/media/tooltips/js/script.min.js
/* * Copyright © 2019 Regular Labs - All Rights Reserved * License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ var RegularLabsTooltips=null;(function($){"use strict";RegularLabsTooltips={options:{},timeout:null,timeoutOff:false,init:function(options){var self=this;options=options?options:this.getOptions();this.options=options;$('.rl_tooltips-link.hover').popover({trigger:'hover',container:'body',delay:{show:5,hide:options.delay_hide}});$('.rl_tooltips-link.click').popover({trigger:'manual',container:'body'}).click(function(evt){self.show($(this),evt,'click');}).mouseout(function(evt){self.setTimer($(this),options.timeout);});$('.rl_tooltips-link.sticky').popover({trigger:'manual',container:'body'}).mouseover(function(evt){self.show($(this),evt,'sticky');}).mouseout(function(evt){self.setTimer($(this),options.timeout);});$('html').click(function(){$('.rl_tooltips-link').popover('hide');});$('html').one('touchstart',function(){$('.rl_tooltips-link.hover').popover({trigger:'manual',container:'body'}).click(function(evt){self.show($(this),evt,'click');self.setTimer($(this),options.delay_hide_touchscreen);});$('.rl_tooltips-link.sticky').popover({trigger:'manual',container:'body'}).click(function(evt){self.show($(this),evt,'click');self.setTimer($(this),options.timeout);});});$('html').on('touchstart',function(e){if($(e.target).closest('.rl_tooltips').length){return;} $('.rl_tooltips-link').popover('hide');});$('.rl_tooltips-link').on('touchstart',function(evt){evt.stopPropagation();});var parentHide=$.fn.popover.Constructor.prototype.hide;$.fn.popover.Constructor.prototype.hide=function(callback){if(options.trigger==="hover"&&this.tip().hasClass('hover')){var self=this;setTimeout(function(){return self.hide.call(self,callback);},options.delay.hide);return;} parentHide.call(this,callback);};if(options.use_auto_positioning){$.fn.popover.Constructor.prototype.show=function(){var el=this;self.fixPlacement(el);}}},show:function(el,event,classname){var self=this;event.stopPropagation();clearTimeout(this.timeout);var popover=typeof el.data('popover')!=='undefined'?el.data('popover'):el.data('bs.popover');$('.rl_tooltips-link.'+classname).each(function(){var popover2=typeof $(this).data('popover')!=='undefined'?$(this).data('popover'):$(this).data('bs.popover');if(popover2!=popover){$(this).popover('hide');}});if(!popover.tip().hasClass('in')){el.popover('show');} $('.rl_tooltips').click(function(evt){evt.stopPropagation();self.timeoutOff=true;clearTimeout(self.timeout);}).mouseover(function(evt){clearTimeout(self.timeout);}).mouseout(function(evt){self.setTimer(el,self.options.timeout);});},setTimer:function(el,timeout){if(!this.timeoutOff&&timeout){this.timeout=setTimeout(function(el){el.popover('hide');},timeout,el);}},fixPlacement:function(el){if(!el.hasContent()||!el.enabled){return;} var event=$.Event('show.bs.'+el.type);if(event.isDefaultPrevented()){return;} var self=this;var $tip=el.tip();$tip.mouseover(function(evt){$tip.addClass('hover');}).mouseout(function(evt){$tip.removeClass('hover');});el.setContent();if(el.options.animation){$tip.addClass('fade');} setTimeout(function(){self.setPlacement(el);},10);el.$element.trigger('shown.bs.'+el.type);},setPlacement:function(el){var $tip=el.tip();var placement=(typeof el.options.placement=='function')?el.options.placement.call(el,$tip[0],el.$element[0]):el.options.placement;$tip.detach().css({top:0,left:0,display:'block'});el.options.container?$tip.appendTo(el.options.container):$tip.insertAfter(el.$element);var newPosition;var position=el.getPosition();var actualWidth=$tip[0].offsetWidth;var actualHeight=$tip[0].offsetHeight;var positionTop={top:position.top-actualHeight,left:position.left+position.width/2-actualWidth/2};var positionBottom={top:position.top+position.height,left:position.left+position.width/2-actualWidth/2};var positionLeft={top:position.top+position.height/2-actualHeight/2,left:position.left-actualWidth};var positionRight={top:position.top+position.height/2-actualHeight/2,left:position.left+position.width};var hasRoomTop=(positionTop.top>$(window).scrollTop());var hasRoomBottom=((positionBottom.top+actualHeight)<($(window).scrollTop()+$(window).height()));var hasRoomLeft=(positionLeft.left>$(window).scrollLeft());var hasRoomRight=((positionRight.left+actualWidth)<($(window).scrollLeft()+$(window).width()));switch(placement){case'top':if(!hasRoomTop){placement=hasRoomBottom?'bottom':(hasRoomRight?'right':(hasRoomLeft?'left':this.options.fallback_position));} break;case'bottom':if(!hasRoomBottom){placement=hasRoomTop?'top':(hasRoomRight?'right':(hasRoomLeft?'left':this.options.fallback_position));} break;case'left':if(!hasRoomLeft){placement=hasRoomRight?'right':(hasRoomTop?'top':(hasRoomBottom?'bottom':this.options.fallback_position));} break;case'right':if(!hasRoomRight){placement=hasRoomLeft?'left':(hasRoomTop?'top':(hasRoomBottom?'bottom':this.options.fallback_position));} break;} switch(placement){case'top':newPosition=positionTop;break;case'bottom':newPosition=positionBottom;break;case'left':newPosition=positionLeft;break;case'right':newPosition=positionRight;break;} el.applyPlacement(newPosition,placement);$tip.removeClass('top bottom left right').addClass(placement);},getOptions:function(){if(typeof rl_tooltips_options!=='undefined'){return rl_tooltips_options;} if(typeof Joomla==='undefined'||typeof Joomla.getOptions==='undefined'){console.error('Joomla.getOptions not found!\nThe Joomla core.js file is not being loaded.');return false;} return Joomla.getOptions('rl_tooltips');}};$(document).ready(function(){RegularLabsTooltips.init();});})(jQuery);