mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
fix(draggable): replaced scrollX/Y with scrollLeft/Top
window.scrollX/Y is only available in Chrome, not in IE
This commit is contained in:
committed by
vieron
parent
c726c4ad9c
commit
bb7463a324
@@ -131,9 +131,9 @@
|
||||
var diff_y = Math.round(mouse_actual_pos.top - this.mouse_init_pos.top);
|
||||
|
||||
var left = Math.round(this.el_init_offset.left +
|
||||
diff_x - this.baseX + window.scrollX - this.win_offset_x);
|
||||
diff_x - this.baseX + $(window).scrollLeft() - this.win_offset_x);
|
||||
var top = Math.round(this.el_init_offset.top +
|
||||
diff_y - this.baseY + window.scrollY - this.win_offset_y);
|
||||
diff_y - this.baseY + $(window).scrollTop() - this.win_offset_y);
|
||||
|
||||
if (this.options.limit) {
|
||||
if (left > this.player_max_left) {
|
||||
@@ -151,8 +151,8 @@
|
||||
pointer: {
|
||||
left: mouse_actual_pos.left,
|
||||
top: mouse_actual_pos.top,
|
||||
diff_left: diff_x + (window.scrollX - this.win_offset_x),
|
||||
diff_top: diff_y + (window.scrollY - this.win_offset_y)
|
||||
diff_left: diff_x + ($(window).scrollLeft() - this.win_offset_x),
|
||||
diff_top: diff_y + ($(window).scrollTop() - this.win_offset_y)
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -299,8 +299,8 @@
|
||||
this.helper = false;
|
||||
}
|
||||
|
||||
this.win_offset_y = window.scrollY;
|
||||
this.win_offset_x = window.scrollX;
|
||||
this.win_offset_y = $(window).scrollTop();
|
||||
this.win_offset_x = $(window).scrollLeft();
|
||||
this.scroll_offset_y = 0;
|
||||
this.scroll_offset_x = 0;
|
||||
this.el_init_offset = this.$player.offset();
|
||||
|
||||
Reference in New Issue
Block a user