Lines Matching full:this
29 /* This currently causes issues with Safari 6, so for it's disabled */
30 …//"use strict"; // (Dis)able ECMAScript "strict" operation for this function. See more: http://ejo…
101 this.id = id;
102 this.target = target;
103 this.tooltip = NULL;
104 this.elements = elements = { target: target };
107 this._id = NAMESPACE + '-' + id;
108 this.timers = { img: {} };
109 this.options = options;
110 this.plugins = {};
113 this.cache = cache = {
123 this.rendered = this.destroyed = this.disabled = this.waiting =
124 this.hiddenDuringWait = this.positioning = this.triggering = FALSE;
129 if(this.rendered || this.destroyed) { return this; } // If tooltip has already been rendered, exit
131 var self = this,
132 options = this.options,
133 cache = this.cache,
134 elements = this.elements,
139 namespace = '.'+this._id+' ',
143 $.attr(this.target[0], 'aria-describedby', this._id);
146 this.tooltip = elements.tooltip = tooltip = $('<div/>', {
147 'id': this._id,
157 'aria-describedby': this._id + '-content',
160 .toggleClass(CLASS_DISABLED, this.disabled)
161 .attr(ATTR_ID, this.id)
162 .data(NAMESPACE, this)
168 'id': this._id + '-content',
174 this.rendered = -1;
175 this.positioning = TRUE;
179 this._createTitle();
183 deferreds.push( this._updateTitle(title, FALSE) );
188 if(button) { this._createButton(); }
192 deferreds.push( this._updateContent(text, FALSE) );
194 this.rendered = TRUE;
197 this._setWidget();
210 if(this.initialize === 'render' && (instance = this(self))) {
216 this._assignEvents();
234 QTIP.api[this.id] = this;
236 return this;
242 if(this.destroyed) { return this.target; }
245 if(this.destroyed) { return; }
246 this.destroyed = TRUE;
248 var target = this.target,
252 if(this.rendered) {
253 this.tooltip.stop(1,0).find('*').remove().end().remove();
257 $.each(this.plugins, function(name) {
258 this.destroy && this.destroy();
262 clearTimeout(this.timers.show);
263 clearTimeout(this.timers.hide);
264 this._unassignEvents();
271 if(this.options.suppress && title) {
275 // Remove qTip events associated with this API
276 this._unbind(target);
280 this.options = this.elements = this.cache = this.timers =
281 this.plugins = this.mouse = NULL;
284 delete QTIP.api[this.id];
288 if(immediate !== TRUE && this.rendered) {
289 tooltip.one('tooltiphidden', $.proxy(process, this));
290 !this.triggering && this.hide();
294 else { process.call(this); }
296 return this.target;
335 var loading = text || $(this).attr(api.options.content.attr) || 'Loading...',
385 this.sanitize && this.sanitize(opts);
400 this._id = new_id;
402 if(this.rendered) {
403 this.tooltip[0].id = this._id;
404 this.elements.content[0].id = this._id + '-content';
405 this.elements.title[0].id = this._id + '-title';
411 v && !this.rendered && this.render(this.options.show.ready);
416 this._updateContent(v);
419 if(this.options.content.text === this.target.attr(prev)) {
420 this._updateContent( this.target.attr(v) );
425 if(!v) { return this._removeTitle(); }
428 v && !this.elements.title && this._createTitle();
429 this._updateTitle(v);
432 this._updateButton(v);
435 this.set('content.'+o, v); // Backwards title.text/button compat
443 this.tooltip.appendTo(v);
448 v && (!this.rendered && this.render(TRUE) || this.toggle(TRUE));
453 this.tooltip.removeClass(p).addClass(v);
456 this.tooltip.css(o, v);
459 this._setWidget();
462 this.tooltip.toggleClass(CLASS_DEFAULT, !!v);
472 var posOptions = this.options.position;
478 this._unassignEvents();
479 this._assignEvents();
500 if(this.destroyed) { return this; }
502 var o = convertNotation(this.options, notation.toLowerCase()),
511 for(category in this.checks) {
512 for(rule in this.checks[category]) {
516 if(category === 'builtin' || this.plugins[category]) {
517 this.checks[category][rule].apply(
518 this.plugins[category] || this, args
530 if(this.destroyed) { return this; }
532 var rendered = this.rendered,
534 options = this.options,
535 checks = this.checks,
569 this.positioning = TRUE;
570 $.each(option, $.proxy(setCallback, this));
571 this.positioning = FALSE;
574 if(this.rendered && this.tooltip[0].offsetWidth > 0 && reposition) {
575 this.reposition( options.position.target === 'mouse' ? NULL : this.cache.event );
578 return this;
582 var self = this,
583 cache = this.cache;
586 if(!this.rendered || !content) { return FALSE; }
590 content = content.call(this.elements.target, cache.event, this) || '';
631 this._update(content, this.elements.content, reposition);
635 if(this._update(content, this.elements.title, reposition) === FALSE) {
636 this._removeTitle(FALSE);
642 var elements = this.elements,
643 id = this._id+'-title';
646 if(elements.titlebar) { this._removeTitle(); }
650 'class': NAMESPACE + '-titlebar ' + (this.options.style.widget ? createWidgetClass('header') : '')
663 $(this).toggleClass('ui-state-active ui-state-focus', event.type.substr(-4) === 'down');
666 $(this).toggleClass('ui-state-hover', event.type === 'mouseover');
670 if(this.options.content.button) { this._createButton(); }
675 var elements = this.elements;
682 if(reposition !== FALSE) { this.reposition(); }
687 if(!this.rendered || this.positioning || this.destroyed) { return this; }
690 this.positioning = TRUE;
692 var cache = this.cache,
693 tooltip = this.tooltip,
694 posOptions = this.options.position,
712 mouse = this.mouse,
731 …(!adjust.mouse || this.options.show.distance) && cache.origin && cache.origin.pageX ? cache.origin…
764 if(target.length === 0) { return this; }
781 pluginCalculations = PLUGINS.imagemap(this, target, at, PLUGINS.viewport ? method : FALSE);
786 pluginCalculations = PLUGINS.svg(this, target, at, PLUGINS.viewport ? method : FALSE);
805 position = this.reposition.offset(target, position, container);
830 this, position, posOptions, targetWidth, targetHeight, elemWidth, elemHeight
842 if(!this._trigger('move', [position, viewport.elem || viewport], event)) { return this; }
852 posOptions.effect.call(tooltip, this, $.extend({}, position));
855 $(this).css({ opacity: '', height: '' });
856 if(BROWSER.ie) { this.style.removeAttribute('filter'); }
863 this.positioning = FALSE;
865 return this;
898 // If this is the first parent element with an overflow of "scroll" or "auto", store it
915 this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
916 this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();
917 this.forceY = !!forceY;
920 this.precedance = (f === 't' || f === 'b' ? Y : X);
924 this[z] = this[z] === LEFT ? RIGHT : this[z] === RIGHT ? LEFT : center || this[z];
928 var x = this.x, y = this.y;
929 return x === y ? x : this.precedance === Y || (this.forceY && y !== 'center') ? y+' '+x : x+' '+y;
933 var result = this.string().split(' ');
938 return new CORNER( this.string(), this.forceY );
941 var cache = this.cache,
942 options = this.options,
943 tooltip = this.tooltip;
950 return this;
958 this.waiting && !state && (this.hiddenDuringWait = TRUE);
961 if(!this.rendered) { return state ? this.render(1) : this; }
962 else if(this.destroyed || this.disabled) { return this; }
965 opts = this.options[type],
966 otherOpts = this.options[ !state ? 'show' : 'hide' ],
967 posOptions = this.options.position,
968 contentOptions = this.options.content,
969 width = this.tooltip.css('width'),
970 visible = this.tooltip[0].offsetWidth > 0,
982 allow = !identicalState ? !!this._trigger(type, [90]) : NULL;
985 if(allow !== FALSE && state) { this.focus(event); }
988 if(!allow || identicalState) { return this; }
996 cache.origin = $.extend({}, this.mouse);
999 if($.isFunction(contentOptions.text)) { this._updateContent(contentOptions.text, FALSE); }
1000 if($.isFunction(contentOptions.title)) { this._updateTitle(contentOptions.title, FALSE); }
1004 $(document).bind('mousemove.'+NAMESPACE, this._storeMouse);
1010 this.reposition(event, arguments[2]);
1021 clearTimeout(this.timers.show);
1033 this.blur(event);
1047 $(this.options.show.autofocus, tooltip).focus();
1051 this.options.show.target.trigger('qtip-'+this.id+'-inactive');
1065 this._trigger(state ? 'visible' : 'hidden');
1066 }, this);
1077 opts.effect.call(tooltip, this);
1087 if(state) { opts.target.trigger('qtip-'+this.id+'-inactive'); }
1089 return this;
1092 PROTOTYPE.show = function(event) { return this.toggle(TRUE, event); };
1094 PROTOTYPE.hide = function(event) { return this.toggle(FALSE, event); };
1097 if(!this.rendered || this.destroyed) { return this; }
1100 tooltip = this.tooltip,
1108 if(this._trigger('focus', [newIndex], event)) {
1113 if(this.style.zIndex > curIndex) {
1114 this.style.zIndex = this.style.zIndex - 1;
1127 return this;
1131 if(!this.rendered || this.destroyed) { return this; }
1134 this.tooltip.removeClass(CLASS_FOCUS);
1137 this._trigger('blur', [ this.tooltip.css('zIndex') ], event);
1139 return this;
1143 if(this.destroyed) { return this; }
1146 state = !(this.tooltip.hasClass(CLASS_DISABLED) || this.disabled);
1149 if(this.rendered) {
1150 this.tooltip.toggleClass(CLASS_DISABLED, state)
1154 this.disabled = !!state;
1156 return this;
1159 PROTOTYPE.enable = function() { return this.disable(FALSE); };
1163 var self = this,
1164 elements = this.elements,
1166 button = this.options.content.button,
1178 'class': 'qtip-close ' + (this.options.style.widget ? '' : NAMESPACE+'-icon'),
1202 if(!this.rendered) { return FALSE; }
1204 var elem = this.elements.button;
1205 if(button) { this._createButton(); }
1217 var on = this.options.style.widget,
1218 elements = this.elements,
1226 …tooltip.toggleClass('ui-helper-reset '+createWidgetClass(), on).toggleClass(CLASS_DEFAULT, this.op…
1238 if(this.tooltip.hasClass(CLASS_DISABLED)) { return FALSE; }
1241 clearTimeout(this.timers.show);
1242 clearTimeout(this.timers.hide);
1245 var callback = $.proxy(function(){ this.toggle(TRUE, event); }, this);
1246 if(this.options.show.delay > 0) {
1247 this.timers.show = setTimeout(callback, this.options.show.delay);
1253 if(this.tooltip.hasClass(CLASS_DISABLED)) { return FALSE; }
1257 ontoTooltip = relatedTarget.closest(SELECTOR)[0] === this.tooltip[0],
1258 ontoTarget = relatedTarget[0] === this.options.show.target[0];
1261 clearTimeout(this.timers.show);
1262 clearTimeout(this.timers.hide);
1266 if(this !== relatedTarget[0] &&
1267 (this.options.position.target === 'mouse' && ontoTooltip) ||
1268 (this.options.hide.fixed && (
1281 var callback = $.proxy(function(){ this.toggle(FALSE, event); }, this);
1282 if(this.options.hide.delay > 0) {
1283 this.timers.hide = setTimeout(callback, this.options.hide.delay);
1289 if(this.tooltip.hasClass(CLASS_DISABLED) || !this.options.hide.inactive) { return FALSE; }
1292 clearTimeout(this.timers.inactive);
1293 this.timers.inactive = setTimeout(
1294 $.proxy(function(){ this.hide(event); }, this), this.options.hide.inactive
1299 if(this.rendered && this.tooltip[0].offsetWidth > 0) { this.reposition(event); }
1304 this.mouse = {
1315 var ns = '.' + this._id + (suffix ? '-'+suffix : '');
1318 $.proxy(method, context || this)
1322 $(targets).unbind('.' + this._id + (suffix ? '-'+suffix : ''));
1331 var api = QTIP.api[ $.attr(this, ATTR_ID) ];
1342 options = this.options;
1347 this.focus(event);
1350 …tooltip.hasClass(CLASS_FIXED) && !tooltip.hasClass(CLASS_DISABLED) && clearTimeout(this.timers.hid…
1358 this.hide(event);
1373 callback.originalEvent = (event && $.extend({}, event)) || this.cache.event || NULL;
1375 this.triggering = TRUE;
1376 this.tooltip.trigger(callback, [this].concat(args || []));
1377 this.triggering = FALSE;
1384 var options = this.options,
1387 tooltip = this.tooltip,
1402 this._bind(documentTarget, ['mouseout', 'blur'], function(event) {
1404 this.hide(event);
1419 this._bind(hideTarget, 'mouseleave', function() {
1420 clearTimeout(this.timers.show);
1426 this._bind(containerTarget.closest('html'), ['mousedown', 'touchstart'], function(event) {
1428 …enabled = this.rendered && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth >…
1429 isAncestor = elem.parents(SELECTOR).filter(this.tooltip[0]).length > 0;
1431 if(elem[0] !== this.target[0] && elem[0] !== this.tooltip[0] && !isAncestor &&
1432 !this.target.has(elem[0]).length && enabled
1434 this.hide(event);
1442 this._bind(showTarget, 'qtip-'+this.id+'-inactive', inactiveMethod);
1445 this._bind(hideTarget.add(tooltip), QTIP.inactiveEvents, inactiveMethod, '-inactive');
1461 this._bind(showTarget, showEvents, showMethod);
1462 this._bind(hideTarget, hideEvents, hideMethod);
1463 this._bind(showTarget, toggleEvents, function(event) {
1464 (this.tooltip[0].offsetWidth > 0 ? hideMethod : showMethod).call(this, event);
1469 this._bind(showTarget.add(tooltip), 'mousemove', function(event) {
1472 var origin = this.cache.origin || {},
1473 limit = this.options.hide.distance,
1478 this.hide(event);
1483 this._storeMouse(event);
1493 this._bind(showTarget, ['mouseenter', 'mouseleave'], function(event) {
1494 this.cache.onTarget = event.type === 'mouseenter';
1499 this._bind(documentTarget, 'mousemove', function(event) {
1501 …if(this.rendered && this.cache.onTarget && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[…
1502 this.reposition(event);
1510 this._bind( $.event.special.resize ? viewportTarget : windowTarget, 'resize', repositionMethod );
1515 this._bind( windowTarget.add(posOptions.container), 'scroll', repositionMethod );
1522 this.options.show.target[0],
1523 this.options.hide.target[0],
1524 this.rendered && this.tooltip[0],
1525 this.options.position.container[0],
1526 this.options.position.viewport[0],
1527 this.options.position.container.closest('html')[0], // unfocus
1533 if(this.rendered) {
1534 this._unbind($([]).pushStack( $.grep(targets, function(i) {
1540 else { $(targets[0]).unbind('.'+this._id+'-create'); }
1626 var api; if((api = $(this).data(NAMESPACE))) { api.destroy(); }
1639 opts = this[0] ? $.data(this[0], NAMESPACE) : NULL;
1649 this.each(function()
1651 var api = $.data(this, NAMESPACE);
1674 return returned !== NULL ? returned : this;
1683 return QTIP.bind.call(this, opts, event);
1690 return this.each(function(i) {
1701 api = init($(this), id, opts);
1708 if(this.initialize === 'initialize') { this(api); }
1778 if(this.length) {
1779 var self = this[0],
1794 return this.attr(oldtitle, val);
1798 return $.fn['attr'+replaceSuffix].apply(this, arguments);
1806 elems = $.fn['clone'+replaceSuffix].apply(this, arguments);
1811 return $.attr(this, oldtitle);
1823 return func.apply(this, arguments) || old.apply(this, arguments);
1828 * This snippet is taken directly from jQuery UI source code found here:
1840 $['cleanData'+replaceSuffix].apply(this, arguments);
1882 $(this).animate(pos, {
1987 this._ns = 'tip';
1988 this.options = options;
1989 this.offset = options.offset;
1990 this.size = [ options.width, options.height ];
1993 this.init( (this.qtip = qtip) );
2001 …tip = this.element = qtip.elements.tip = $('<div />', { 'class': NAMESPACE+'-tip' }).prependTo(qti…
2006 context = $('<canvas />').appendTo(this.element)[0].getContext('2d');
2015 this.element.html(context + context);
2018 …*', tip).add(tip), ['click', 'mousedown'], function(event) { event.stopPropagation(); }, this._ns);
2022 qtip._bind(qtip.tooltip, 'tooltipmove', this.reposition, this._ns, this);
2025 this.create();
2029 this.size[0] = this.options.height;
2030 this.size[1] = this.options.width;
2033 this.size[0] = this.options.width;
2034 this.size[1] = this.options.height;
2038 var titlebar = this.qtip.elements.titlebar;
2040 …corner.y === TOP || (corner.y === CENTER && this.element.position().top + (this.size[1] / 2) + thi…
2045 var my = this.qtip.options.position.my;
2063 var elements = this.qtip.elements,
2068 intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) ||
2074 var elements = this.qtip.elements,
2078 intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) ||
2088 var elements = this.qtip.elements,
2089 tip = this.element.css('cssText', ''),
2091 colorElem = this._useTitle(corner) && elements.titlebar || elements.content,
2092 css = this._invalidColour, color = [];
2110 width = this.options[ y ? 'height' : 'width' ],
2111 height = this.options[ y ? 'width' : 'height' ],
2119 hyp = [ (this.border / base) * smallHyp, (this.border / height) * smallHyp ];
2121 hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(this.border, 2) );
2122 hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(this.border, 2) );
2134 var width = this.size[0], height = this.size[1],
2158 var c = this.corner = (HASCANVAS || BROWSER.ie) && this._parseCorner(this.options.corner);
2161 if( (this.enabled = !!this.corner && this.corner.abbrev() !== 'c') ) {
2163 this.qtip.cache.corner = c.clone();
2166 this.update();
2170 this.element.toggle(this.enabled);
2172 return this.corner;
2176 if(!this.enabled) { return this; }
2178 var elements = this.qtip.elements,
2179 tip = this.element,
2181 options = this.options,
2182 size = this.size,
2189 if(!corner) { corner = this.qtip.cache.corner || this.corner; }
2208 if(corner.precedance === X) { this._swapDimensions(); }
2209 else { this._resetDimensions(); }
2212 color = this.color = this._parseColours(corner);
2217 border = this.border = this._parseWidth(corner, corner[corner.precedance]);
2223 this.border = border = options.border !== TRUE ? options.border : border;
2227 else { this.border = border = 0; }
2230 coords = this._calculateTip(mimic);
2233 newSize = this.size = this._calculateSize(corner);
2311 var $this = $(this);
2314 $this[ $this.prop ? 'prop' : 'attr' ]({
2324 !i && $this.html( createVML(
2331 if(position !== FALSE) { this.calculate(corner); }
2335 if(!this.enabled) { return FALSE; }
2337 var self = this,
2338 elements = this.qtip.elements,
2339 tip = this.element,
2340 userOffset = this.options.offset,
2341 isWidget = this.qtip.tooltip.hasClass('ui-widget'),
2346 corner = corner || this.corner;
2350 size = this._calculateSize(corner);
2383 if(!this.enabled) { return; }
2386 newCorner = this.corner.clone(),
2395 if(this.corner.fixed !== TRUE) {
2414 this.update(newCorner, FALSE);
2419 offset = this.calculate(newCorner, adjust);
2424 offset.user = this.offset;
2465 this.element.css(css).toggle(
2480 this.qtip._unbind(this.qtip.tooltip, this._ns);
2483 if(this.qtip.elements.tip) {
2484 this.qtip.elements.tip.find('*')
2510 this.create();
2513 this.qtip.reposition();
2517 this.size = size = [ obj.width, obj.height ];
2518 this.update();
2521 this.qtip.reposition();
2524 this.update();