mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix issue with line height calculation when using older versions of jQuery
This commit is contained in:
@@ -58,7 +58,11 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
getLineHeight: function(elem) {
|
getLineHeight: function(elem) {
|
||||||
return parseInt($(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']().css('fontSize'), 10);
|
var $parent = $(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
|
||||||
|
if (!$parent.length) {
|
||||||
|
$parent = $('body');
|
||||||
|
}
|
||||||
|
return parseInt($parent.css('fontSize'), 10);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPageHeight: function(elem) {
|
getPageHeight: function(elem) {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
$('#jqueryVersion').html($.fn.jquery);
|
$('#jqueryVersion').html($.fn.jquery);
|
||||||
|
|
||||||
var loghandle = function(event, delta) {
|
var loghandle = function(event, delta) {
|
||||||
var o = '', id = event.currentTarget.id;
|
var o = '', id = event.currentTarget.id || event.currentTarget.nodeName;
|
||||||
|
|
||||||
o = '#' + id + ':';
|
o = '#' + id + ':';
|
||||||
|
|
||||||
@@ -137,6 +137,11 @@
|
|||||||
log( o );
|
log( o );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$(document)
|
||||||
|
.mousewheel(function(event, delta) {
|
||||||
|
loghandle(event, delta);
|
||||||
|
});
|
||||||
|
|
||||||
$('#test1')
|
$('#test1')
|
||||||
.mousewheel(function(event, delta) {
|
.mousewheel(function(event, delta) {
|
||||||
loghandle(event, delta);
|
loghandle(event, delta);
|
||||||
|
|||||||
Reference in New Issue
Block a user