mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
Fix SVG bound calculation for tooltips in Firefox
This commit is contained in:
parent
868e8b25b6
commit
e5be8d47ef
@ -118,7 +118,7 @@
|
|||||||
var $el = $(this);
|
var $el = $(this);
|
||||||
$el.attr('title', $el.attr('title-rich') || $el.attr('title'));
|
$el.attr('title', $el.attr('title-rich') || $el.attr('title'));
|
||||||
});
|
});
|
||||||
$('svg rect.chart-data[title]', el).tipsy({ gravity: 'e', html: true });
|
$('svg rect.chart-data[title]', el).tipsy({ gravity: 'se', html: true });
|
||||||
$('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 });
|
$('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 });
|
||||||
$('img.icon[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 });
|
$('img.icon[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 });
|
||||||
$('[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, delayIn: 500 });
|
$('[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, delayIn: 500 });
|
||||||
|
22
public/js/vendor/SOURCE.jquery.tipsy
vendored
22
public/js/vendor/SOURCE.jquery.tipsy
vendored
@ -25,9 +25,27 @@ This file contains information about how to acquire and install the source files
|
|||||||
https://github.com/jaz303/tipsy.git
|
https://github.com/jaz303/tipsy.git
|
||||||
|
|
||||||
|
|
||||||
# installation
|
# apply hotfix (firefox SVG bound calculation)
|
||||||
|
|
||||||
|
--- jquery.tipsy.js
|
||||||
|
+++ jquery.tipsy.js
|
||||||
|
@@ -34,8 +34,8 @@
|
||||||
|
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
|
||||||
|
|
||||||
|
var pos = $.extend({}, this.$element.offset(), {
|
||||||
|
- width: this.$element[0].offsetWidth,
|
||||||
|
- height: this.$element[0].offsetHeight
|
||||||
|
+ width: this.$element[0].offsetWidth || this.$element[0].getBoundingClientRect().width,
|
||||||
|
+ height: this.$element[0].offsetHeight || this.$element[0].getBoundingClientRect().height
|
||||||
|
});
|
||||||
|
|
||||||
|
var actualWidth = $tip[0].offsetWidth,
|
||||||
|
|
||||||
|
|
||||||
|
# installation
|
||||||
|
|
||||||
mv src/javascript/tipsy.css ICINGAWEB/public/css/vendor/tipsy.css
|
mv src/javascript/tipsy.css ICINGAWEB/public/css/vendor/tipsy.css
|
||||||
mv src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.js
|
mv src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.js
|
||||||
uglifyjs src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.min.js
|
uglifyjs src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.min.js
|
||||||
|
|
||||||
|
|
||||||
|
4
public/js/vendor/jquery.tipsy.js
vendored
4
public/js/vendor/jquery.tipsy.js
vendored
@ -34,8 +34,8 @@
|
|||||||
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
|
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
|
||||||
|
|
||||||
var pos = $.extend({}, this.$element.offset(), {
|
var pos = $.extend({}, this.$element.offset(), {
|
||||||
width: this.$element[0].offsetWidth,
|
width: this.$element[0].offsetWidth || this.$element[0].getBoundingClientRect().width,
|
||||||
height: this.$element[0].offsetHeight
|
height: this.$element[0].offsetHeight || this.$element[0].getBoundingClientRect().height
|
||||||
});
|
});
|
||||||
|
|
||||||
var actualWidth = $tip[0].offsetWidth,
|
var actualWidth = $tip[0].offsetWidth,
|
||||||
|
8
public/js/vendor/jquery.tipsy.min.js
vendored
8
public/js/vendor/jquery.tipsy.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user