Skip to content

Commit b9bbdc1

Browse files
author
Zoltan Szabo
committed
Fixed overlay issues in chrome when page is zoomed
1 parent 4da8adf commit b9bbdc1

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/HISTORY.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Changelog
33

44
5.1-dev - (unreleased)
55
----------------------
6+
* Bug fix: Fixed
7+
[szabozo0 refs #5568]
68

79
5.0 - (2012-10-08)
810
------------------

eea/forms/browser/js/edit.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,19 @@ jQuery.fn.EEASlide = function(options) {
296296
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
297297
var distance = options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
298298
if (mode == 'show'){
299-
el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift
299+
var tmp_pos = motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance;
300+
el.css(ref, tmp_pos); // Shift
301+
302+
// fix for chrome when page is zoomed
303+
if (el.css(ref) != tmp_pos){
304+
// if the position is different than what we wanted,
305+
// recalculate it with the ratio between the original value and the one we get from the element
306+
var el_pos = el.css(ref);
307+
var ratio = tmp_pos/parseInt(el_pos);
308+
el.css(ref, tmp_pos * ratio);
309+
}
310+
// end of fix
311+
300312
}
301313
var pos = parseInt(el.css('left'), 10);
302314
pos = pos < 0 ? pos * -1 : pos;

0 commit comments

Comments
 (0)