jquery-qtip2-wrapper-rails 2.2.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jquery/qtip2/wrapper/rails/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.qtip.js +199 -166
- data/vendor/assets/javascripts/jquery.qtip.min.js +4 -4
- data/vendor/assets/javascripts/jquery.qtip.min.map +1 -0
- data/vendor/assets/stylesheets/jquery.qtip.css +4 -4
- data/vendor/assets/stylesheets/jquery.qtip.min.css +1 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a61a3fdb1cb95a45e3411755e4b1c0aad66e38df
|
4
|
+
data.tar.gz: e2fcae0b12b1b6e3b5c9f6a4db9abc9a73eba8ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b51bd123183588268d1f09cd6cf1de156810734a35873114220516c102a99e86be03edc7dda456837cedf92a0e23f7b2cfc43df9aae2234285a26609d4fa3a45
|
7
|
+
data.tar.gz: 1e86a0b3815b59e61e6ae67a71720aa14bdb8e3d4cc0baa676f9084bc10bd792c818e3dbe342b45e0f4836ccc113989e4ba9da5cbca8da6b9a19f23f469ffa75
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/*
|
2
|
-
* qTip2 - Pretty powerful tooltips -
|
2
|
+
* qTip2 - Pretty powerful tooltips - v3.0.2
|
3
3
|
* http://qtip2.com
|
4
4
|
*
|
5
|
-
* Copyright (c)
|
5
|
+
* Copyright (c) 2015
|
6
6
|
* Released under the MIT licenses
|
7
7
|
* http://jquery.org/license
|
8
8
|
*
|
9
|
-
* Date:
|
9
|
+
* Date: Tue Dec 8 2015 07:16 GMT+0000
|
10
10
|
* Plugins: tips modal viewport svg imagemap ie6
|
11
11
|
* Styles: core basic css3
|
12
12
|
*/
|
@@ -77,14 +77,17 @@ BROWSER = {
|
|
77
77
|
* Adapted from: http://ajaxian.com/archives/attack-of-the-ie-conditional-comment
|
78
78
|
* Credit to James Padolsey for the original implemntation!
|
79
79
|
*/
|
80
|
-
ie: (function(){
|
80
|
+
ie: (function() {
|
81
|
+
/* eslint-disable no-empty */
|
82
|
+
var v, i;
|
81
83
|
for (
|
82
|
-
|
83
|
-
(i.innerHTML =
|
84
|
+
v = 4, i = document.createElement('div');
|
85
|
+
(i.innerHTML = '<!--[if gt IE ' + v + ']><i></i><![endif]-->') && i.getElementsByTagName('i')[0];
|
84
86
|
v+=1
|
85
87
|
) {}
|
86
88
|
return v > 4 ? v : NaN;
|
87
|
-
|
89
|
+
/* eslint-enable no-empty */
|
90
|
+
})(),
|
88
91
|
|
89
92
|
/*
|
90
93
|
* iOS version detection
|
@@ -138,9 +141,7 @@ PROTOTYPE.render = function(show) {
|
|
138
141
|
title = options.content.title,
|
139
142
|
button = options.content.button,
|
140
143
|
posOptions = options.position,
|
141
|
-
|
142
|
-
deferreds = [],
|
143
|
-
tooltip;
|
144
|
+
deferreds = [];
|
144
145
|
|
145
146
|
// Add ARIA attributes to target
|
146
147
|
$.attr(this.target[0], 'aria-describedby', this._id);
|
@@ -151,7 +152,7 @@ PROTOTYPE.render = function(show) {
|
|
151
152
|
);
|
152
153
|
|
153
154
|
// Create tooltip element
|
154
|
-
this.tooltip = elements.tooltip =
|
155
|
+
this.tooltip = elements.tooltip = $('<div/>', {
|
155
156
|
'id': this._id,
|
156
157
|
'class': [ NAMESPACE, CLASS_DEFAULT, options.style.classes, cache.posClass ].join(' '),
|
157
158
|
'width': options.style.width || '',
|
@@ -256,13 +257,15 @@ PROTOTYPE.destroy = function(immediate) {
|
|
256
257
|
}
|
257
258
|
|
258
259
|
// Destroy all plugins
|
259
|
-
$.each(this.plugins, function(
|
260
|
+
$.each(this.plugins, function() {
|
260
261
|
this.destroy && this.destroy();
|
261
262
|
});
|
262
263
|
|
263
264
|
// Clear timers
|
264
|
-
for(timer in this.timers) {
|
265
|
-
|
265
|
+
for (timer in this.timers) {
|
266
|
+
if (this.timers.hasOwnProperty(timer)) {
|
267
|
+
clearTimeout(this.timers[timer]);
|
268
|
+
}
|
266
269
|
}
|
267
270
|
|
268
271
|
// Remove api object and ARIA attributes
|
@@ -288,7 +291,7 @@ PROTOTYPE.destroy = function(immediate) {
|
|
288
291
|
delete QTIP.api[this.id];
|
289
292
|
}
|
290
293
|
|
291
|
-
// If an immediate
|
294
|
+
// If an immediate destroy is needed
|
292
295
|
if((immediate !== TRUE || this.triggering === 'hide') && this.rendered) {
|
293
296
|
this.tooltip.one('tooltiphidden', $.proxy(process, this));
|
294
297
|
!this.triggering && this.hide();
|
@@ -304,7 +307,7 @@ PROTOTYPE.destroy = function(immediate) {
|
|
304
307
|
}
|
305
308
|
|
306
309
|
function invalidContent(c) {
|
307
|
-
return !(
|
310
|
+
return !($.isFunction(c) || c && c.attr) || c.length || $.type(c) === 'object' && (c.jquery || c.then);
|
308
311
|
}
|
309
312
|
|
310
313
|
// Option object sanitizer
|
@@ -321,8 +324,9 @@ function sanitizeOptions(opts) {
|
|
321
324
|
content = opts.content;
|
322
325
|
|
323
326
|
if(invalidOpt(content) || content.jquery || content.done) {
|
327
|
+
text = invalidContent(content) ? FALSE : content;
|
324
328
|
content = opts.content = {
|
325
|
-
text:
|
329
|
+
text: text
|
326
330
|
};
|
327
331
|
}
|
328
332
|
else { text = content.text; }
|
@@ -341,9 +345,9 @@ function sanitizeOptions(opts) {
|
|
341
345
|
$.extend({}, ajax, { context: api })
|
342
346
|
)
|
343
347
|
.then(ajax.success, NULL, ajax.error)
|
344
|
-
.then(function(
|
345
|
-
if(
|
346
|
-
return
|
348
|
+
.then(function(newContent) {
|
349
|
+
if(newContent && once) { api.set('content.text', newContent); }
|
350
|
+
return newContent;
|
347
351
|
},
|
348
352
|
function(xhr, status, error) {
|
349
353
|
if(api.destroyed || xhr.status === 0) { return; }
|
@@ -397,10 +401,10 @@ CHECKS = PROTOTYPE.checks = {
|
|
397
401
|
// Core checks
|
398
402
|
'^id$': function(obj, o, v, prev) {
|
399
403
|
var id = v === TRUE ? QTIP.nextid : v,
|
400
|
-
|
404
|
+
newId = NAMESPACE + '-' + id;
|
401
405
|
|
402
|
-
if(id !== FALSE && id.length > 0 && !$('#'+
|
403
|
-
this._id =
|
406
|
+
if(id !== FALSE && id.length > 0 && !$('#'+newId).length) {
|
407
|
+
this._id = newId;
|
404
408
|
|
405
409
|
if(this.rendered) {
|
406
410
|
this.tooltip[0].id = this._id;
|
@@ -440,7 +444,9 @@ CHECKS = PROTOTYPE.checks = {
|
|
440
444
|
|
441
445
|
// Position checks
|
442
446
|
'^position.(my|at)$': function(obj, o, v){
|
443
|
-
'string' === typeof v
|
447
|
+
if('string' === typeof v) {
|
448
|
+
this.position[o] = obj[o] = new CORNER(v, o === 'at');
|
449
|
+
}
|
444
450
|
},
|
445
451
|
'^position.container$': function(obj, o, v){
|
446
452
|
this.rendered && this.tooltip.appendTo(v);
|
@@ -493,7 +499,7 @@ function convertNotation(options, notation) {
|
|
493
499
|
levels = notation.split('.');
|
494
500
|
|
495
501
|
// Loop through
|
496
|
-
while(
|
502
|
+
while(option = option[ levels[i++] ]) {
|
497
503
|
if(i < levels.length) { obj = option; }
|
498
504
|
}
|
499
505
|
|
@@ -513,7 +519,11 @@ function setCallback(notation, args) {
|
|
513
519
|
var category, rule, match;
|
514
520
|
|
515
521
|
for(category in this.checks) {
|
522
|
+
if (!this.checks.hasOwnProperty(category)) { continue; }
|
523
|
+
|
516
524
|
for(rule in this.checks[category]) {
|
525
|
+
if (!this.checks[category].hasOwnProperty(rule)) { continue; }
|
526
|
+
|
517
527
|
if(match = (new RegExp(rule, 'i')).exec(notation)) {
|
518
528
|
args.push(match);
|
519
529
|
|
@@ -536,7 +546,6 @@ PROTOTYPE.set = function(option, value) {
|
|
536
546
|
var rendered = this.rendered,
|
537
547
|
reposition = FALSE,
|
538
548
|
options = this.options,
|
539
|
-
checks = this.checks,
|
540
549
|
name;
|
541
550
|
|
542
551
|
// Convert singular option/value pair into object form
|
@@ -546,7 +555,7 @@ PROTOTYPE.set = function(option, value) {
|
|
546
555
|
else { option = $.extend({}, option); }
|
547
556
|
|
548
557
|
// Set all of the defined options to their new values
|
549
|
-
$.each(option, function(notation,
|
558
|
+
$.each(option, function(notation, val) {
|
550
559
|
if(rendered && rrender.test(notation)) {
|
551
560
|
delete option[notation]; return;
|
552
561
|
}
|
@@ -554,13 +563,13 @@ PROTOTYPE.set = function(option, value) {
|
|
554
563
|
// Set new obj value
|
555
564
|
var obj = convertNotation(options, notation.toLowerCase()), previous;
|
556
565
|
previous = obj[0][ obj[1] ];
|
557
|
-
obj[0][ obj[1] ] =
|
566
|
+
obj[0][ obj[1] ] = val && val.nodeType ? $(val) : val;
|
558
567
|
|
559
568
|
// Also check if we need to reposition
|
560
569
|
reposition = rmove.test(notation) || reposition;
|
561
570
|
|
562
571
|
// Set the new params for the callback
|
563
|
-
option[notation] = [obj[0], obj[1],
|
572
|
+
option[notation] = [obj[0], obj[1], val, previous];
|
564
573
|
});
|
565
574
|
|
566
575
|
// Re-sanitize options
|
@@ -581,7 +590,7 @@ PROTOTYPE.set = function(option, value) {
|
|
581
590
|
|
582
591
|
return this;
|
583
592
|
};
|
584
|
-
;PROTOTYPE._update = function(content, element
|
593
|
+
;PROTOTYPE._update = function(content, element) {
|
585
594
|
var self = this,
|
586
595
|
cache = this.cache;
|
587
596
|
|
@@ -605,7 +614,7 @@ PROTOTYPE.set = function(option, value) {
|
|
605
614
|
}
|
606
615
|
|
607
616
|
// If content is null... return false
|
608
|
-
if(content === FALSE ||
|
617
|
+
if(content === FALSE || !content && content !== '') { return FALSE; }
|
609
618
|
|
610
619
|
// Append new content if its a DOM array and show it if hidden
|
611
620
|
if(content.jquery && content.length > 0) {
|
@@ -632,7 +641,7 @@ PROTOTYPE._waitForContent = function(element) {
|
|
632
641
|
cache.waiting = TRUE;
|
633
642
|
|
634
643
|
// If imagesLoaded is included, ensure images have loaded and return promise
|
635
|
-
return ( $.fn.imagesLoaded ? element.imagesLoaded() : $.Deferred().resolve([]) )
|
644
|
+
return ( $.fn.imagesLoaded ? element.imagesLoaded() : new $.Deferred().resolve([]) )
|
636
645
|
.done(function() { cache.waiting = FALSE; })
|
637
646
|
.promise();
|
638
647
|
};
|
@@ -743,7 +752,7 @@ PROTOTYPE.reposition = function(event, effect) {
|
|
743
752
|
}
|
744
753
|
|
745
754
|
// Use cached event for resize/scroll events
|
746
|
-
else if(!event ||
|
755
|
+
else if(!event || event && (event.type === 'resize' || event.type === 'scroll')) {
|
747
756
|
event = cache.event;
|
748
757
|
}
|
749
758
|
|
@@ -833,16 +842,16 @@ PROTOTYPE.reposition = function(event, effect) {
|
|
833
842
|
position = this.reposition.offset(target, position, container);
|
834
843
|
|
835
844
|
// Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2-4.0 & v4.3-4.3.2)
|
836
|
-
if(
|
837
|
-
|
838
|
-
|
845
|
+
if(BROWSER.iOS > 3.1 && BROWSER.iOS < 4.1 ||
|
846
|
+
BROWSER.iOS >= 4.3 && BROWSER.iOS < 4.33 ||
|
847
|
+
!BROWSER.iOS && type === 'fixed'
|
839
848
|
){
|
840
849
|
position.left -= win.scrollLeft();
|
841
850
|
position.top -= win.scrollTop();
|
842
851
|
}
|
843
852
|
|
844
853
|
// Adjust position relative to target
|
845
|
-
if(!pluginCalculations ||
|
854
|
+
if(!pluginCalculations || pluginCalculations && pluginCalculations.adjustable !== FALSE) {
|
846
855
|
position.left += at.x === RIGHT ? targetWidth : at.x === CENTER ? targetWidth / 2 : 0;
|
847
856
|
position.top += at.y === BOTTOM ? targetHeight : at.y === CENTER ? targetHeight / 2 : 0;
|
848
857
|
}
|
@@ -871,7 +880,8 @@ PROTOTYPE.reposition = function(event, effect) {
|
|
871
880
|
|
872
881
|
// Set tooltip position class if it's changed
|
873
882
|
if(cache.posClass !== (newClass = this._createPosClass(this.position.my))) {
|
874
|
-
|
883
|
+
cache.posClass = newClass;
|
884
|
+
tooltip.removeClass(cache.posClass).addClass(newClass);
|
875
885
|
}
|
876
886
|
|
877
887
|
// tooltipmove event
|
@@ -924,8 +934,8 @@ PROTOTYPE.reposition.offset = function(elem, pos, container) {
|
|
924
934
|
}
|
925
935
|
else {
|
926
936
|
parentOffset = $(parent).position();
|
927
|
-
parentOffset.left +=
|
928
|
-
parentOffset.top +=
|
937
|
+
parentOffset.left += parseFloat($.css(parent, 'borderLeftWidth')) || 0;
|
938
|
+
parentOffset.top += parseFloat($.css(parent, 'borderTopWidth')) || 0;
|
929
939
|
}
|
930
940
|
|
931
941
|
pos.left -= parentOffset.left + (parseFloat($.css(parent, 'marginLeft')) || 0);
|
@@ -935,7 +945,7 @@ PROTOTYPE.reposition.offset = function(elem, pos, container) {
|
|
935
945
|
if(!scrolled && (overflow = $.css(parent, 'overflow')) !== 'hidden' && overflow !== 'visible') { scrolled = $(parent); }
|
936
946
|
}
|
937
947
|
}
|
938
|
-
while(
|
948
|
+
while(parent = parent.offsetParent);
|
939
949
|
|
940
950
|
// Compensate for containers scroll if it also has an offsetParent (or in IE quirks mode)
|
941
951
|
if(scrolled && (scrolled[0] !== ownerDocument[0] || quirks)) {
|
@@ -953,7 +963,7 @@ var C = (CORNER = PROTOTYPE.reposition.Corner = function(corner, forceY) {
|
|
953
963
|
this.forceY = !!forceY;
|
954
964
|
|
955
965
|
var f = corner.charAt(0);
|
956
|
-
this.precedance =
|
966
|
+
this.precedance = f === 't' || f === 'b' ? Y : X;
|
957
967
|
}).prototype;
|
958
968
|
|
959
969
|
C.invert = function(z, center) {
|
@@ -964,10 +974,10 @@ C.string = function(join) {
|
|
964
974
|
var x = this.x, y = this.y;
|
965
975
|
|
966
976
|
var result = x !== y ?
|
967
|
-
|
968
|
-
[y,x] :
|
969
|
-
|
970
|
-
|
977
|
+
x === 'center' || y !== 'center' && (this.precedance === Y || this.forceY) ?
|
978
|
+
[y,x] :
|
979
|
+
[x,y] :
|
980
|
+
[x];
|
971
981
|
|
972
982
|
return join !== false ? result.join(' ') : result;
|
973
983
|
};
|
@@ -1008,14 +1018,13 @@ PROTOTYPE.toggle = function(state, event) {
|
|
1008
1018
|
|
1009
1019
|
var type = state ? 'show' : 'hide',
|
1010
1020
|
opts = this.options[type],
|
1011
|
-
otherOpts = this.options[ !state ? 'show' : 'hide' ],
|
1012
1021
|
posOptions = this.options.position,
|
1013
1022
|
contentOptions = this.options.content,
|
1014
1023
|
width = this.tooltip.css('width'),
|
1015
1024
|
visible = this.tooltip.is(':visible'),
|
1016
1025
|
animate = state || opts.target.length === 1,
|
1017
1026
|
sameTarget = !event || opts.target.length < 2 || cache.target[0] === event.target,
|
1018
|
-
identicalState, allow,
|
1027
|
+
identicalState, allow, after;
|
1019
1028
|
|
1020
1029
|
// Detect state if valid one isn't provided
|
1021
1030
|
if((typeof state).search('boolean|number')) { state = !visible; }
|
@@ -1061,7 +1070,7 @@ PROTOTYPE.toggle = function(state, event) {
|
|
1061
1070
|
// Hide other tooltips if tooltip is solo
|
1062
1071
|
if(!!opts.solo) {
|
1063
1072
|
(typeof opts.solo === 'string' ? $(opts.solo) : $(SELECTOR, opts.solo))
|
1064
|
-
.not(tooltip).not(opts.target).qtip('hide', $.Event('tooltipsolo'));
|
1073
|
+
.not(tooltip).not(opts.target).qtip('hide', new $.Event('tooltipsolo'));
|
1065
1074
|
}
|
1066
1075
|
}
|
1067
1076
|
else {
|
@@ -1146,8 +1155,7 @@ PROTOTYPE.hide = function(event) { return this.toggle(FALSE, event); };
|
|
1146
1155
|
var qtips = $(SELECTOR),
|
1147
1156
|
tooltip = this.tooltip,
|
1148
1157
|
curIndex = parseInt(tooltip[0].style.zIndex, 10),
|
1149
|
-
newIndex = QTIP.zindex + qtips.length
|
1150
|
-
focusedElem;
|
1158
|
+
newIndex = QTIP.zindex + qtips.length;
|
1151
1159
|
|
1152
1160
|
// Only update the z-index if it has changed and tooltip is not already focused
|
1153
1161
|
if(!tooltip.hasClass(CLASS_FOCUS)) {
|
@@ -1325,14 +1333,16 @@ function hideMethod(event) {
|
|
1325
1333
|
// Or if mouse positioning is enabled and cursor momentarily overlaps
|
1326
1334
|
if(this !== relatedTarget[0] &&
|
1327
1335
|
(this.options.position.target === 'mouse' && ontoTooltip) ||
|
1328
|
-
|
1336
|
+
this.options.hide.fixed && (
|
1329
1337
|
(/mouse(out|leave|move)/).test(event.type) && (ontoTooltip || ontoTarget))
|
1330
|
-
)
|
1338
|
+
)
|
1331
1339
|
{
|
1340
|
+
/* eslint-disable no-empty */
|
1332
1341
|
try {
|
1333
1342
|
event.preventDefault();
|
1334
1343
|
event.stopImmediatePropagation();
|
1335
1344
|
} catch(e) {}
|
1345
|
+
/* eslint-enable no-empty */
|
1336
1346
|
|
1337
1347
|
return;
|
1338
1348
|
}
|
@@ -1394,8 +1404,8 @@ function delegate(selector, events, method) {
|
|
1394
1404
|
}
|
1395
1405
|
// Event trigger
|
1396
1406
|
PROTOTYPE._trigger = function(type, args, event) {
|
1397
|
-
var callback = $.Event('tooltip'+type);
|
1398
|
-
callback.originalEvent =
|
1407
|
+
var callback = new $.Event('tooltip'+type);
|
1408
|
+
callback.originalEvent = event && $.extend({}, event) || this.cache.event || NULL;
|
1399
1409
|
|
1400
1410
|
this.triggering = type;
|
1401
1411
|
this.tooltip.trigger(callback, [this].concat(args || []));
|
@@ -1404,7 +1414,7 @@ PROTOTYPE._trigger = function(type, args, event) {
|
|
1404
1414
|
return !callback.isDefaultPrevented();
|
1405
1415
|
};
|
1406
1416
|
|
1407
|
-
PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTargets, hideTargets,
|
1417
|
+
PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTargets, hideTargets, showCallback, hideCallback) {
|
1408
1418
|
// Get tasrgets that lye within both
|
1409
1419
|
var similarTargets = showTargets.filter( hideTargets ).add( hideTargets.filter(showTargets) ),
|
1410
1420
|
toggleEvents = [];
|
@@ -1426,7 +1436,7 @@ PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTargets, hideTarget
|
|
1426
1436
|
// Bind toggle events to the similar targets
|
1427
1437
|
this._bind(similarTargets, toggleEvents, function(event) {
|
1428
1438
|
var state = this.rendered ? this.tooltip[0].offsetWidth > 0 : false;
|
1429
|
-
(state ?
|
1439
|
+
(state ? hideCallback : showCallback).call(this, event);
|
1430
1440
|
});
|
1431
1441
|
|
1432
1442
|
// Remove the similar targets from the regular show/hide bindings
|
@@ -1436,8 +1446,8 @@ PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTargets, hideTarget
|
|
1436
1446
|
}
|
1437
1447
|
|
1438
1448
|
// Apply show/hide/toggle events
|
1439
|
-
this._bind(showTargets, showEvents,
|
1440
|
-
this._bind(hideTargets, hideEvents,
|
1449
|
+
this._bind(showTargets, showEvents, showCallback);
|
1450
|
+
this._bind(hideTargets, hideEvents, hideCallback);
|
1441
1451
|
};
|
1442
1452
|
|
1443
1453
|
PROTOTYPE._assignInitialEvents = function(event) {
|
@@ -1448,7 +1458,7 @@ PROTOTYPE._assignInitialEvents = function(event) {
|
|
1448
1458
|
hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : [];
|
1449
1459
|
|
1450
1460
|
// Catch remove/removeqtip events on target element to destroy redundant tooltips
|
1451
|
-
this._bind(this.elements.target, ['remove', 'removeqtip'], function(
|
1461
|
+
this._bind(this.elements.target, ['remove', 'removeqtip'], function() {
|
1452
1462
|
this.destroy(true);
|
1453
1463
|
}, 'destroy');
|
1454
1464
|
|
@@ -1465,24 +1475,24 @@ PROTOTYPE._assignInitialEvents = function(event) {
|
|
1465
1475
|
* on show targets before the tooltip has rendered. Also set onTarget when triggered to
|
1466
1476
|
* keep mouse tracking working.
|
1467
1477
|
*/
|
1468
|
-
this._bind(showTarget, 'mousemove', function(
|
1469
|
-
this._storeMouse(
|
1478
|
+
this._bind(showTarget, 'mousemove', function(moveEvent) {
|
1479
|
+
this._storeMouse(moveEvent);
|
1470
1480
|
this.cache.onTarget = TRUE;
|
1471
1481
|
});
|
1472
1482
|
|
1473
1483
|
// Define hoverIntent function
|
1474
|
-
function hoverIntent(
|
1484
|
+
function hoverIntent(hoverEvent) {
|
1475
1485
|
// Only continue if tooltip isn't disabled
|
1476
1486
|
if(this.disabled || this.destroyed) { return FALSE; }
|
1477
1487
|
|
1478
1488
|
// Cache the event data
|
1479
|
-
this.cache.event =
|
1480
|
-
this.cache.target =
|
1489
|
+
this.cache.event = hoverEvent && $.event.fix(hoverEvent);
|
1490
|
+
this.cache.target = hoverEvent && $(hoverEvent.target);
|
1481
1491
|
|
1482
1492
|
// Start the event sequence
|
1483
1493
|
clearTimeout(this.timers.show);
|
1484
1494
|
this.timers.show = delay.call(this,
|
1485
|
-
function() { this.render(typeof
|
1495
|
+
function() { this.render(typeof hoverEvent === 'object' || options.show.ready); },
|
1486
1496
|
options.prerender ? 0 : options.show.delay
|
1487
1497
|
);
|
1488
1498
|
}
|
@@ -1509,7 +1519,6 @@ PROTOTYPE._assignEvents = function() {
|
|
1509
1519
|
containerTarget = posOptions.container,
|
1510
1520
|
viewportTarget = posOptions.viewport,
|
1511
1521
|
documentTarget = $(document),
|
1512
|
-
bodyTarget = $(document.body),
|
1513
1522
|
windowTarget = $(window),
|
1514
1523
|
|
1515
1524
|
showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [],
|
@@ -1699,7 +1708,7 @@ function init(elem, id, opts) {
|
|
1699
1708
|
newTarget = elem[0] === document ? docBody : elem,
|
1700
1709
|
|
1701
1710
|
// Grab metadata from element if plugin is present
|
1702
|
-
metadata =
|
1711
|
+
metadata = elem.metadata ? elem.metadata(opts.metadata) : NULL,
|
1703
1712
|
|
1704
1713
|
// If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise
|
1705
1714
|
metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL,
|
@@ -1708,7 +1717,10 @@ function init(elem, id, opts) {
|
|
1708
1717
|
html5 = elem.data(opts.metadata.name || 'qtipopts');
|
1709
1718
|
|
1710
1719
|
// If we don't get an object returned attempt to parse it manualyl without parseJSON
|
1711
|
-
|
1720
|
+
/* eslint-disable no-empty */
|
1721
|
+
try { html5 = typeof html5 === 'string' ? $.parseJSON(html5) : html5; }
|
1722
|
+
catch(e) {}
|
1723
|
+
/* eslint-enable no-empty */
|
1712
1724
|
|
1713
1725
|
// Merge in and sanitize metadata
|
1714
1726
|
config = $.extend(TRUE, {}, QTIP.defaults, opts,
|
@@ -1781,7 +1793,7 @@ QTIP = $.fn.qtip = function(options, notation, newValue)
|
|
1781
1793
|
opts = this[0] ? $.data(this[0], NAMESPACE) : NULL;
|
1782
1794
|
|
1783
1795
|
// Check for API request
|
1784
|
-
if(
|
1796
|
+
if(!arguments.length && opts || command === 'api') {
|
1785
1797
|
return opts;
|
1786
1798
|
}
|
1787
1799
|
|
@@ -1855,7 +1867,7 @@ QTIP.api = {};
|
|
1855
1867
|
title = 'title',
|
1856
1868
|
api = $.data(self, 'qtip');
|
1857
1869
|
|
1858
|
-
if(attr === title && api && 'object' === typeof api && api.options.suppress) {
|
1870
|
+
if(attr === title && api && api.options && 'object' === typeof api && 'object' === typeof api.options && api.options.suppress) {
|
1859
1871
|
if(arguments.length < 2) {
|
1860
1872
|
return $.attr(self, oldtitle);
|
1861
1873
|
}
|
@@ -1875,10 +1887,8 @@ QTIP.api = {};
|
|
1875
1887
|
|
1876
1888
|
/* Allow clone to correctly retrieve cached title attributes */
|
1877
1889
|
clone: function(keepData) {
|
1878
|
-
var titles = $([]), title = 'title',
|
1879
|
-
|
1880
1890
|
// Clone our element using the real clone method
|
1881
|
-
elems = $.fn['clone'+replaceSuffix].apply(this, arguments);
|
1891
|
+
var elems = $.fn['clone'+replaceSuffix].apply(this, arguments);
|
1882
1892
|
|
1883
1893
|
// Grab all elements with an oldtitle set, and change it to regular title attribute, if keepData is false
|
1884
1894
|
if(!keepData) {
|
@@ -1908,15 +1918,17 @@ if(!$.ui) {
|
|
1908
1918
|
$.cleanData = function( elems ) {
|
1909
1919
|
for(var i = 0, elem; (elem = $( elems[i] )).length; i++) {
|
1910
1920
|
if(elem.attr(ATTR_HAS)) {
|
1921
|
+
/* eslint-disable no-empty */
|
1911
1922
|
try { elem.triggerHandler('removeqtip'); }
|
1912
1923
|
catch( e ) {}
|
1924
|
+
/* eslint-enable no-empty */
|
1913
1925
|
}
|
1914
1926
|
}
|
1915
1927
|
$['cleanData'+replaceSuffix].apply(this, arguments);
|
1916
1928
|
};
|
1917
1929
|
}
|
1918
1930
|
;// qTip version
|
1919
|
-
QTIP.version = '
|
1931
|
+
QTIP.version = '3.0.2';
|
1920
1932
|
|
1921
1933
|
// Base ID for all qTips
|
1922
1934
|
QTIP.nextid = 0;
|
@@ -1952,7 +1964,7 @@ QTIP.defaults = {
|
|
1952
1964
|
resize: TRUE,
|
1953
1965
|
method: 'flipinvert flipinvert'
|
1954
1966
|
},
|
1955
|
-
effect: function(api, pos
|
1967
|
+
effect: function(api, pos) {
|
1956
1968
|
$(this).animate(pos, {
|
1957
1969
|
duration: 200,
|
1958
1970
|
queue: FALSE
|
@@ -1998,9 +2010,10 @@ QTIP.defaults = {
|
|
1998
2010
|
}
|
1999
2011
|
};
|
2000
2012
|
;var TIP,
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2013
|
+
createVML,
|
2014
|
+
SCALE,
|
2015
|
+
PIXEL_RATIO,
|
2016
|
+
BACKING_STORE_RATIO,
|
2004
2017
|
|
2005
2018
|
// Common CSS strings
|
2006
2019
|
MARGIN = 'margin',
|
@@ -2024,7 +2037,7 @@ function camel(s) { return s.charAt(0).toUpperCase() + s.slice(1); }
|
|
2024
2037
|
* Modified from Modernizr's testPropsAll()
|
2025
2038
|
* http://modernizr.com/downloads/modernizr-latest.js
|
2026
2039
|
*/
|
2027
|
-
var cssProps = {}, cssPrefixes = [
|
2040
|
+
var cssProps = {}, cssPrefixes = ['Webkit', 'O', 'Moz', 'ms'];
|
2028
2041
|
function vendorCss(elem, prop) {
|
2029
2042
|
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
|
2030
2043
|
props = (prop + ' ' + cssPrefixes.join(ucProp + ' ') + ucProp).split(' '),
|
@@ -2033,9 +2046,10 @@ function vendorCss(elem, prop) {
|
|
2033
2046
|
// If the property has already been mapped...
|
2034
2047
|
if(cssProps[prop]) { return elem.css(cssProps[prop]); }
|
2035
2048
|
|
2036
|
-
while(
|
2049
|
+
while(cur = props[i++]) {
|
2037
2050
|
if((val = elem.css(cur)) !== undefined) {
|
2038
|
-
|
2051
|
+
cssProps[prop] = cur;
|
2052
|
+
return val;
|
2039
2053
|
}
|
2040
2054
|
}
|
2041
2055
|
}
|
@@ -2048,7 +2062,7 @@ function intCss(elem, prop) {
|
|
2048
2062
|
|
2049
2063
|
// VML creation (for IE only)
|
2050
2064
|
if(!HASCANVAS) {
|
2051
|
-
|
2065
|
+
createVML = function(tag, props, style) {
|
2052
2066
|
return '<qtipvml:'+tag+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(props||'')+
|
2053
2067
|
' style="behavior: url(#default#VML); '+(style||'')+ '" />';
|
2054
2068
|
};
|
@@ -2056,13 +2070,13 @@ if(!HASCANVAS) {
|
|
2056
2070
|
|
2057
2071
|
// Canvas only definitions
|
2058
2072
|
else {
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2073
|
+
PIXEL_RATIO = window.devicePixelRatio || 1;
|
2074
|
+
BACKING_STORE_RATIO = (function() {
|
2075
|
+
var context = document.createElement('canvas').getContext('2d');
|
2076
|
+
return context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio ||
|
2077
|
+
context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || 1;
|
2078
|
+
})();
|
2079
|
+
SCALE = PIXEL_RATIO / BACKING_STORE_RATIO;
|
2066
2080
|
}
|
2067
2081
|
|
2068
2082
|
|
@@ -2073,7 +2087,8 @@ function Tip(qtip, options) {
|
|
2073
2087
|
this.size = [ options.width, options.height ];
|
2074
2088
|
|
2075
2089
|
// Initialize
|
2076
|
-
this.
|
2090
|
+
this.qtip = qtip;
|
2091
|
+
this.init(qtip);
|
2077
2092
|
}
|
2078
2093
|
|
2079
2094
|
$.extend(Tip.prototype, {
|
@@ -2120,7 +2135,7 @@ $.extend(Tip.prototype, {
|
|
2120
2135
|
_useTitle: function(corner) {
|
2121
2136
|
var titlebar = this.qtip.elements.titlebar;
|
2122
2137
|
return titlebar && (
|
2123
|
-
corner.y === TOP ||
|
2138
|
+
corner.y === TOP || corner.y === CENTER && this.element.position().top + this.size[1] / 2 + this.options.offset < titlebar.outerHeight(TRUE)
|
2124
2139
|
);
|
2125
2140
|
},
|
2126
2141
|
|
@@ -2146,11 +2161,11 @@ $.extend(Tip.prototype, {
|
|
2146
2161
|
var elements = this.qtip.elements,
|
2147
2162
|
prop = BORDER + camel(side) + 'Width';
|
2148
2163
|
|
2149
|
-
return (use ? intCss(use, prop) :
|
2164
|
+
return (use ? intCss(use, prop) :
|
2150
2165
|
intCss(elements.content, prop) ||
|
2151
2166
|
intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) ||
|
2152
2167
|
intCss(elements.tooltip, prop)
|
2153
|
-
)
|
2168
|
+
) || 0;
|
2154
2169
|
},
|
2155
2170
|
|
2156
2171
|
_parseRadius: function(corner) {
|
@@ -2164,7 +2179,7 @@ $.extend(Tip.prototype, {
|
|
2164
2179
|
|
2165
2180
|
_invalidColour: function(elem, prop, compare) {
|
2166
2181
|
var val = elem.css(prop);
|
2167
|
-
return !val ||
|
2182
|
+
return !val || compare && val === elem.css(compare) || INVALID.test(val) ? FALSE : val;
|
2168
2183
|
},
|
2169
2184
|
|
2170
2185
|
_parseColours: function(corner) {
|
@@ -2190,8 +2205,8 @@ $.extend(Tip.prototype, {
|
|
2190
2205
|
|
2191
2206
|
_calculateSize: function(corner) {
|
2192
2207
|
var y = corner.precedance === Y,
|
2193
|
-
width = this.options
|
2194
|
-
height = this.options
|
2208
|
+
width = this.options.width,
|
2209
|
+
height = this.options.height,
|
2195
2210
|
isCenter = corner.abbrev() === 'c',
|
2196
2211
|
base = (y ? width: height) * (isCenter ? 0.5 : 1),
|
2197
2212
|
pow = Math.pow,
|
@@ -2199,7 +2214,10 @@ $.extend(Tip.prototype, {
|
|
2199
2214
|
bigHyp, ratio, result,
|
2200
2215
|
|
2201
2216
|
smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ),
|
2202
|
-
hyp = [
|
2217
|
+
hyp = [
|
2218
|
+
this.border / base * smallHyp,
|
2219
|
+
this.border / height * smallHyp
|
2220
|
+
];
|
2203
2221
|
|
2204
2222
|
hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(this.border, 2) );
|
2205
2223
|
hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(this.border, 2) );
|
@@ -2253,7 +2271,8 @@ $.extend(Tip.prototype, {
|
|
2253
2271
|
var c = this.corner = (HASCANVAS || BROWSER.ie) && this._parseCorner(this.options.corner);
|
2254
2272
|
|
2255
2273
|
// If we have a tip corner...
|
2256
|
-
|
2274
|
+
this.enabled = !!this.corner && this.corner.abbrev() !== 'c';
|
2275
|
+
if(this.enabled) {
|
2257
2276
|
// Cache it
|
2258
2277
|
this.qtip.cache.corner = c.clone();
|
2259
2278
|
|
@@ -2278,7 +2297,7 @@ $.extend(Tip.prototype, {
|
|
2278
2297
|
mimic = options.mimic,
|
2279
2298
|
round = Math.round,
|
2280
2299
|
color, precedance, context,
|
2281
|
-
coords, bigCoords, translate, newSize, border
|
2300
|
+
coords, bigCoords, translate, newSize, border;
|
2282
2301
|
|
2283
2302
|
// Re-determine tip if not already set
|
2284
2303
|
if(!corner) { corner = this.qtip.cache.corner || this.corner; }
|
@@ -2385,10 +2404,10 @@ $.extend(Tip.prototype, {
|
|
2385
2404
|
|
2386
2405
|
// Set initial CSS
|
2387
2406
|
inner.css({
|
2388
|
-
coordsize:
|
2407
|
+
coordsize: newSize[0]+border + ' ' + newSize[1]+border,
|
2389
2408
|
antialias: ''+(mimic.string().indexOf(CENTER) > -1),
|
2390
|
-
left: translate[0] -
|
2391
|
-
top: translate[1] -
|
2409
|
+
left: translate[0] - translate[2] * Number(precedance === X),
|
2410
|
+
top: translate[1] - translate[2] * Number(precedance === Y),
|
2392
2411
|
width: newSize[0] + border,
|
2393
2412
|
height: newSize[1] + border
|
2394
2413
|
})
|
@@ -2397,7 +2416,7 @@ $.extend(Tip.prototype, {
|
|
2397
2416
|
|
2398
2417
|
// Set shape specific attributes
|
2399
2418
|
$this[ $this.prop ? 'prop' : 'attr' ]({
|
2400
|
-
coordsize:
|
2419
|
+
coordsize: newSize[0]+border + ' ' + newSize[1]+border,
|
2401
2420
|
path: coords,
|
2402
2421
|
fillcolor: color[0],
|
2403
2422
|
filled: !!i,
|
@@ -2407,7 +2426,7 @@ $.extend(Tip.prototype, {
|
|
2407
2426
|
|
2408
2427
|
// Check if border is enabled and add stroke element
|
2409
2428
|
!i && $this.html( createVML(
|
2410
|
-
'stroke', 'weight="'+
|
2429
|
+
'stroke', 'weight="'+border*2+'px" color="'+color[1]+'" miterlimit="1000" joinstyle="miter"'
|
2411
2430
|
) );
|
2412
2431
|
});
|
2413
2432
|
}
|
@@ -2432,8 +2451,7 @@ $.extend(Tip.prototype, {
|
|
2432
2451
|
elements = this.qtip.elements,
|
2433
2452
|
tip = this.element,
|
2434
2453
|
userOffset = this.options.offset,
|
2435
|
-
|
2436
|
-
position = { },
|
2454
|
+
position = {},
|
2437
2455
|
precedance, corners;
|
2438
2456
|
|
2439
2457
|
// Inherit corner if not provided
|
@@ -2461,7 +2479,7 @@ $.extend(Tip.prototype, {
|
|
2461
2479
|
bc = self._parseWidth(corner, side, elements.content);
|
2462
2480
|
br = self._parseRadius(corner);
|
2463
2481
|
|
2464
|
-
position[ side ] = Math.max(-self.border, i ? bc :
|
2482
|
+
position[ side ] = Math.max(-self.border, i ? bc : userOffset + (br > b ? br : -b));
|
2465
2483
|
}
|
2466
2484
|
});
|
2467
2485
|
|
@@ -2473,7 +2491,7 @@ $.extend(Tip.prototype, {
|
|
2473
2491
|
return position;
|
2474
2492
|
},
|
2475
2493
|
|
2476
|
-
reposition: function(event, api, pos
|
2494
|
+
reposition: function(event, api, pos) {
|
2477
2495
|
if(!this.enabled) { return; }
|
2478
2496
|
|
2479
2497
|
var cache = api.cache,
|
@@ -2492,7 +2510,8 @@ $.extend(Tip.prototype, {
|
|
2492
2510
|
}
|
2493
2511
|
else if(direction !== SHIFT && adjust[side]){
|
2494
2512
|
newCorner[precedance] = newCorner[precedance] === CENTER ?
|
2495
|
-
|
2513
|
+
adjust[side] > 0 ? side : opposite :
|
2514
|
+
newCorner[precedance] === side ? opposite : side;
|
2496
2515
|
}
|
2497
2516
|
}
|
2498
2517
|
|
@@ -2534,8 +2553,14 @@ $.extend(Tip.prototype, {
|
|
2534
2553
|
offset.user = this.offset;
|
2535
2554
|
|
2536
2555
|
// Perform shift adjustments
|
2537
|
-
|
2538
|
-
if(shift.
|
2556
|
+
shift.left = horizontal === SHIFT && !!adjust.left;
|
2557
|
+
if(shift.left) {
|
2558
|
+
shiftonly(X, LEFT, RIGHT);
|
2559
|
+
}
|
2560
|
+
shift.top = vertical === SHIFT && !!adjust.top;
|
2561
|
+
if(shift.top) {
|
2562
|
+
shiftonly(Y, TOP, BOTTOM);
|
2563
|
+
}
|
2539
2564
|
|
2540
2565
|
/*
|
2541
2566
|
* If the tip is adjusted in both dimensions, or in a
|
@@ -2543,7 +2568,7 @@ $.extend(Tip.prototype, {
|
|
2543
2568
|
* outer border, hide it!
|
2544
2569
|
*/
|
2545
2570
|
this.element.css(css).toggle(
|
2546
|
-
!(
|
2571
|
+
!(shift.x && shift.y || newCorner.x === CENTER && shift.y || newCorner.y === CENTER && shift.x)
|
2547
2572
|
);
|
2548
2573
|
|
2549
2574
|
// Adjust position to accomodate tip dimensions
|
@@ -2628,8 +2653,9 @@ OVERLAY = function()
|
|
2628
2653
|
{
|
2629
2654
|
var self = this,
|
2630
2655
|
focusableElems = {},
|
2631
|
-
current,
|
2632
|
-
prevState,
|
2656
|
+
current,
|
2657
|
+
prevState,
|
2658
|
+
elem;
|
2633
2659
|
|
2634
2660
|
// Modified code from jQuery UI 1.10.0 source
|
2635
2661
|
// http://code.jquery.com/ui/1.10.0/jquery-ui.js
|
@@ -2650,12 +2676,13 @@ OVERLAY = function()
|
|
2650
2676
|
img = $('img[usemap=#' + mapName + ']')[0];
|
2651
2677
|
return !!img && img.is(':visible');
|
2652
2678
|
}
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2679
|
+
|
2680
|
+
return /input|select|textarea|button|object/.test( nodeName ) ?
|
2681
|
+
!element.disabled :
|
2682
|
+
'a' === nodeName ?
|
2683
|
+
element.href || isTabIndexNotNaN :
|
2684
|
+
isTabIndexNotNaN
|
2685
|
+
;
|
2659
2686
|
}
|
2660
2687
|
|
2661
2688
|
// Focus inputs using cached focusable elements (see update())
|
@@ -2678,7 +2705,7 @@ OVERLAY = function()
|
|
2678
2705
|
|
2679
2706
|
// Determine if input container target is above this
|
2680
2707
|
targetOnTop = container.length < 1 ? FALSE :
|
2681
|
-
|
2708
|
+
parseInt(container[0].style.zIndex, 10) > parseInt(tooltip[0].style.zIndex, 10);
|
2682
2709
|
|
2683
2710
|
// If we're showing a modal, but focus has landed on an input below
|
2684
2711
|
// this modal, divert focus to the first visible input in this modal
|
@@ -2686,9 +2713,6 @@ OVERLAY = function()
|
|
2686
2713
|
if(!targetOnTop && target.closest(SELECTOR)[0] !== tooltip[0]) {
|
2687
2714
|
focusInputs(target);
|
2688
2715
|
}
|
2689
|
-
|
2690
|
-
// Detect when we leave the last focusable element...
|
2691
|
-
onLast = event.target === focusableElems[focusableElems.length - 1];
|
2692
2716
|
}
|
2693
2717
|
|
2694
2718
|
$.extend(self, {
|
@@ -2735,14 +2759,12 @@ OVERLAY = function()
|
|
2735
2759
|
},
|
2736
2760
|
|
2737
2761
|
toggle: function(api, state, duration) {
|
2738
|
-
var
|
2739
|
-
tooltip = api.tooltip,
|
2762
|
+
var tooltip = api.tooltip,
|
2740
2763
|
options = api.options.show.modal,
|
2741
2764
|
effect = options.effect,
|
2742
2765
|
type = state ? 'show': 'hide',
|
2743
2766
|
visible = elem.is(':visible'),
|
2744
|
-
visibleModals = $(MODALSELECTOR).filter(':visible:not(:animated)').not(tooltip)
|
2745
|
-
zindex;
|
2767
|
+
visibleModals = $(MODALSELECTOR).filter(':visible:not(:animated)').not(tooltip);
|
2746
2768
|
|
2747
2769
|
// Set active tooltip API reference
|
2748
2770
|
self.update(api);
|
@@ -2762,7 +2784,7 @@ OVERLAY = function()
|
|
2762
2784
|
}
|
2763
2785
|
|
2764
2786
|
// Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible
|
2765
|
-
if(
|
2787
|
+
if(elem.is(':animated') && visible === state && prevState !== FALSE || !state && visibleModals.length) {
|
2766
2788
|
return self;
|
2767
2789
|
}
|
2768
2790
|
|
@@ -2813,7 +2835,8 @@ function Modal(api, options) {
|
|
2813
2835
|
this.options = options;
|
2814
2836
|
this._ns = '-modal';
|
2815
2837
|
|
2816
|
-
this.
|
2838
|
+
this.qtip = api;
|
2839
|
+
this.init(api);
|
2817
2840
|
}
|
2818
2841
|
|
2819
2842
|
$.extend(Modal.prototype, {
|
@@ -2836,9 +2859,12 @@ $.extend(Modal.prototype, {
|
|
2836
2859
|
// Make sure mouseout doesn't trigger a hide when showing the modal and mousing onto backdrop
|
2837
2860
|
if(event.target === tooltip[0]) {
|
2838
2861
|
if(oEvent && event.type === 'tooltiphide' && /mouse(leave|enter)/.test(oEvent.type) && $(oEvent.relatedTarget).closest(OVERLAY.elem[0]).length) {
|
2839
|
-
|
2862
|
+
/* eslint-disable no-empty */
|
2863
|
+
try { event.preventDefault(); }
|
2864
|
+
catch(e) {}
|
2865
|
+
/* eslint-enable no-empty */
|
2840
2866
|
}
|
2841
|
-
else if(!oEvent ||
|
2867
|
+
else if(!oEvent || oEvent && oEvent.type !== 'tooltipsolo') {
|
2842
2868
|
this.toggle(event, event.type === 'tooltipshow', duration);
|
2843
2869
|
}
|
2844
2870
|
}
|
@@ -2875,7 +2901,10 @@ $.extend(Modal.prototype, {
|
|
2875
2901
|
OVERLAY.update(api);
|
2876
2902
|
|
2877
2903
|
// Prevent default handling
|
2878
|
-
|
2904
|
+
/* eslint-disable no-empty */
|
2905
|
+
try { event.preventDefault(); }
|
2906
|
+
catch(e) {}
|
2907
|
+
/* eslint-enable no-empty */
|
2879
2908
|
}, this._ns, this);
|
2880
2909
|
|
2881
2910
|
// Focus any other visible modals when this one hides
|
@@ -2921,7 +2950,9 @@ MODAL.sanitize = function(opts) {
|
|
2921
2950
|
};
|
2922
2951
|
|
2923
2952
|
// Base z-index for all modal tooltips (use qTip core z-index as a base)
|
2953
|
+
/* eslint-disable camelcase */
|
2924
2954
|
QTIP.modal_zindex = QTIP.zindex - 200;
|
2955
|
+
/* eslint-enable camelcase */
|
2925
2956
|
|
2926
2957
|
// Plugin needs to be initialized on render
|
2927
2958
|
MODAL.initialize = 'render';
|
@@ -2964,7 +2995,6 @@ $.extend(TRUE, QTIP.defaults, {
|
|
2964
2995
|
methodY = method[1] || method[0],
|
2965
2996
|
viewport = posOptions.viewport,
|
2966
2997
|
container = posOptions.container,
|
2967
|
-
cache = api.cache,
|
2968
2998
|
adjusted = { left: 0, top: 0 },
|
2969
2999
|
fixed, newMy, containerOffset, containerStatic,
|
2970
3000
|
viewportWidth, viewportHeight, viewportScroll, viewportOffset;
|
@@ -2986,7 +3016,7 @@ $.extend(TRUE, QTIP.defaults, {
|
|
2986
3016
|
viewportOffset = viewport.offset() || adjusted;
|
2987
3017
|
|
2988
3018
|
// Generic calculation method
|
2989
|
-
function calculate(side, otherSide, type,
|
3019
|
+
function calculate(side, otherSide, type, adjustment, side1, side2, lengthName, targetLength, elemLength) {
|
2990
3020
|
var initialPos = position[side1],
|
2991
3021
|
mySide = my[side],
|
2992
3022
|
atSide = at[side],
|
@@ -3024,22 +3054,22 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3024
3054
|
// flip/flipinvert
|
3025
3055
|
else {
|
3026
3056
|
// Update adjustment amount depending on if using flipinvert or flip
|
3027
|
-
|
3057
|
+
adjustment *= type === FLIPINVERT ? 2 : 0;
|
3028
3058
|
|
3029
3059
|
// Check for overflow on the left/top
|
3030
3060
|
if(overflow1 > 0 && (mySide !== side1 || overflow2 > 0)) {
|
3031
|
-
position[side1] -= offset +
|
3061
|
+
position[side1] -= offset + adjustment;
|
3032
3062
|
newMy.invert(side, side1);
|
3033
3063
|
}
|
3034
3064
|
|
3035
3065
|
// Check for overflow on the bottom/right
|
3036
3066
|
else if(overflow2 > 0 && (mySide !== side2 || overflow1 > 0) ) {
|
3037
|
-
position[side1] -= (mySide === CENTER ? -offset : offset) +
|
3067
|
+
position[side1] -= (mySide === CENTER ? -offset : offset) + adjustment;
|
3038
3068
|
newMy.invert(side, side2);
|
3039
3069
|
}
|
3040
3070
|
|
3041
3071
|
// Make sure we haven't made things worse with the adjustment and reset if so
|
3042
|
-
if(position[side1] < viewportScroll && -position[side1] > overflow2) {
|
3072
|
+
if(position[side1] < viewportScroll[side1] && -position[side1] > overflow2) {
|
3043
3073
|
position[side1] = initialPos; newMy = my.clone();
|
3044
3074
|
}
|
3045
3075
|
}
|
@@ -3079,7 +3109,8 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3079
3109
|
newWidth, newHeight;
|
3080
3110
|
|
3081
3111
|
// First pass, sanitize coords and determine outer edges
|
3082
|
-
i = baseCoords.length;
|
3112
|
+
i = baseCoords.length;
|
3113
|
+
while(i--) {
|
3083
3114
|
next = [ parseInt(baseCoords[--i], 10), parseInt(baseCoords[i+1], 10) ];
|
3084
3115
|
|
3085
3116
|
if(next[0] > result.position.right){ result.position.right = next[0]; }
|
@@ -3097,8 +3128,8 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3097
3128
|
// If it's the center corner...
|
3098
3129
|
if(corner.abbrev() === 'c') {
|
3099
3130
|
result.position = {
|
3100
|
-
left: result.position.left +
|
3101
|
-
top: result.position.top +
|
3131
|
+
left: result.position.left + result.width / 2,
|
3132
|
+
top: result.position.top + result.height / 2
|
3102
3133
|
};
|
3103
3134
|
}
|
3104
3135
|
else {
|
@@ -3116,19 +3147,21 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3116
3147
|
else if(corner.y === BOTTOM){ compareY = result.height - newHeight; }
|
3117
3148
|
else{ compareY += Math.floor(newHeight / 2); }
|
3118
3149
|
|
3119
|
-
i = coords.length;
|
3150
|
+
i = coords.length;
|
3151
|
+
while(i--)
|
3120
3152
|
{
|
3121
3153
|
if(coords.length < 2){ break; }
|
3122
3154
|
|
3123
3155
|
realX = coords[i][0] - result.position.left;
|
3124
3156
|
realY = coords[i][1] - result.position.top;
|
3125
3157
|
|
3126
|
-
if(
|
3127
|
-
|
3128
|
-
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3158
|
+
if(
|
3159
|
+
corner.x === LEFT && realX >= compareX ||
|
3160
|
+
corner.x === RIGHT && realX <= compareX ||
|
3161
|
+
corner.x === CENTER && (realX < compareX || realX > result.width - compareX) ||
|
3162
|
+
corner.y === TOP && realY >= compareY ||
|
3163
|
+
corner.y === BOTTOM && realY <= compareY ||
|
3164
|
+
corner.y === CENTER && (realY < compareY || realY > result.height - compareY)) {
|
3132
3165
|
coords.splice(i, 1);
|
3133
3166
|
}
|
3134
3167
|
}
|
@@ -3161,8 +3194,8 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3161
3194
|
rys = ry * Math.sin( c * Math.PI );
|
3162
3195
|
|
3163
3196
|
return {
|
3164
|
-
width:
|
3165
|
-
height:
|
3197
|
+
width: rx * 2 - Math.abs(rxc),
|
3198
|
+
height: ry * 2 - Math.abs(rys),
|
3166
3199
|
position: {
|
3167
3200
|
left: cx + rxc,
|
3168
3201
|
top: cy + rys
|
@@ -3176,14 +3209,13 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3176
3209
|
};
|
3177
3210
|
;PLUGINS.svg = function(api, svg, corner)
|
3178
3211
|
{
|
3179
|
-
var
|
3180
|
-
elem = svg[0],
|
3212
|
+
var elem = svg[0],
|
3181
3213
|
root = $(elem.ownerSVGElement),
|
3182
3214
|
ownerDocument = elem.ownerDocument,
|
3183
3215
|
strokeWidth2 = (parseInt(svg.css('stroke-width'), 10) || 0) / 2,
|
3184
|
-
frameOffset, mtx, transformed,
|
3216
|
+
frameOffset, mtx, transformed,
|
3185
3217
|
len, next, i, points,
|
3186
|
-
result, position
|
3218
|
+
result, position;
|
3187
3219
|
|
3188
3220
|
// Ascend the parentNode chain until we find an element with getBBox()
|
3189
3221
|
while(!elem.getBBox) { elem = elem.parentNode; }
|
@@ -3265,7 +3297,7 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3265
3297
|
|
3266
3298
|
return result;
|
3267
3299
|
};
|
3268
|
-
;PLUGINS.imagemap = function(api, area, corner
|
3300
|
+
;PLUGINS.imagemap = function(api, area, corner)
|
3269
3301
|
{
|
3270
3302
|
if(!area.jquery) { area = $(area); }
|
3271
3303
|
|
@@ -3273,7 +3305,7 @@ $.extend(TRUE, QTIP.defaults, {
|
|
3273
3305
|
image = $('img[usemap="#'+area.parent('map').attr('name')+'"]'),
|
3274
3306
|
coordsString = $.trim(area.attr('coords')),
|
3275
3307
|
coordsArray = coordsString.replace(/,$/, '').split(','),
|
3276
|
-
imageOffset, coords, i,
|
3308
|
+
imageOffset, coords, i, result, len;
|
3277
3309
|
|
3278
3310
|
// If we can't find the image using the map...
|
3279
3311
|
if(!image.length) { return FALSE; }
|
@@ -3318,9 +3350,11 @@ BGIFRAME = '<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="jav
|
|
3318
3350
|
' style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); ' +
|
3319
3351
|
'-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';
|
3320
3352
|
|
3321
|
-
function Ie6(api
|
3353
|
+
function Ie6(api) {
|
3322
3354
|
this._ns = 'ie6';
|
3323
|
-
|
3355
|
+
|
3356
|
+
this.qtip = api;
|
3357
|
+
this.init(api);
|
3324
3358
|
}
|
3325
3359
|
|
3326
3360
|
$.extend(Ie6.prototype, {
|
@@ -3330,8 +3364,7 @@ $.extend(Ie6.prototype, {
|
|
3330
3364
|
},
|
3331
3365
|
|
3332
3366
|
init: function(qtip) {
|
3333
|
-
var tooltip = qtip.tooltip
|
3334
|
-
scroll;
|
3367
|
+
var tooltip = qtip.tooltip;
|
3335
3368
|
|
3336
3369
|
// Create the BGIFrame element if needed
|
3337
3370
|
if($('select, object').length < 1) {
|
@@ -3371,7 +3404,7 @@ $.extend(Ie6.prototype, {
|
|
3371
3404
|
|
3372
3405
|
// Adjust for tips plugin
|
3373
3406
|
if(plugin && tip) {
|
3374
|
-
tipAdjust =
|
3407
|
+
tipAdjust = plugin.corner.precedance === 'x' ? [WIDTH, LEFT] : [HEIGHT, TOP];
|
3375
3408
|
offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ]();
|
3376
3409
|
}
|
3377
3410
|
|
@@ -3410,8 +3443,8 @@ $.extend(Ie6.prototype, {
|
|
3410
3443
|
|
3411
3444
|
// Parse into proper pixel values
|
3412
3445
|
perc = (max + min).indexOf('%') > -1 ? container.width() / 100 : 0;
|
3413
|
-
|
3414
|
-
min = (
|
3446
|
+
max = (max.indexOf('%') > -1 ? perc : 1 * parseInt(max, 10)) || width;
|
3447
|
+
min = (min.indexOf('%') > -1 ? perc : 1 * parseInt(min, 10)) || 0;
|
3415
3448
|
|
3416
3449
|
// Determine new dimension size based on max/min/current values
|
3417
3450
|
width = max + min ? Math.min(Math.max(width, min), max) : width;
|
@@ -3448,4 +3481,4 @@ CHECKS.ie6 = {
|
|
3448
3481
|
}
|
3449
3482
|
};
|
3450
3483
|
;}));
|
3451
|
-
}( window, document ));
|
3484
|
+
}( window, document ));
|