Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/tooltip.min.js |
define ("core/tooltip",["jquery"],function(a){var b=function(b){this._regionSelector=b;a(this._regionSelector).each(function(b,c){var d=a(c).attr("aria-describedby");if(d){var e=document.getElementById(d);if(e){var f="tooltip"==a(e).attr("role");if(f){a(e).hide();a(c).attr("tabindex","0")}a(c).on("focus",this._handleFocus.bind(this));a(c).on("mouseover",this._handleMouseOver.bind(this));a(c).on("mouseout",this._handleMouseOut.bind(this));a(c).on("blur",this._handleBlur.bind(this));a(c).on("keydown",this._handleKeyDown.bind(this))}}}.bind(this))};b.prototype._regionSelector=null;b.prototype._showTooltip=function(b){var c=a(b.target),d=c.attr("aria-describedby");if(d){var e=a(document.getElementById(d));e.show();e.attr("aria-hidden","false");if(!e.is(".tooltip")){var f=a("<div class=\"tooltip-inner\"></div>");f.append(e.contents());e.append(f);e.addClass("tooltip");e.addClass("bottom");e.append("<div class=\"tooltip-arrow\"></div>")}var g=c.offset();g.top+=c.height()+10;a(e).offset(g)}};b.prototype._hideTooltip=function(b){var c=a(b.target),d=c.attr("aria-describedby");if(d){var e=document.getElementById(d);a(e).hide();a(e).attr("aria-hidden","true")}};b.prototype._handleFocus=function(a){this._showTooltip(a)};b.prototype._handleKeyDown=function(a){if(27==a.which){this._hideTooltip(a)}};b.prototype._handleMouseOver=function(a){this._showTooltip(a)};b.prototype._handleMouseOut=function(b){var c=a(b.target);if(!c.is(":focus")){this._hideTooltip(b)}};b.prototype._handleBlur=function(a){this._hideTooltip(a)};return b}); //# sourceMappingURL=tooltip.min.js.map