Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix opener positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 23, 2015
1 parent db31374 commit a850de3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/src/plugins/editor.diaporama/class.Diaporama.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,13 @@ Class.create("Diaporama", AbstractEditor, {
});
}
var off = theImage.positionedOffset();
var marginTop = (theImage.getStyle('marginTop')) ? parseInt(theImage.getStyle('marginTop')) : 0;
var realLeftOffset = Math.max(off.left, theImage.parentNode.positionedOffset().left);
theImage.previewOpener.setStyle({
display:'block',
left: (realLeftOffset + 1) + 'px',
width: (theImage.getWidth() - 2) + "px",
top: (off.top + theImage.getHeight() - theImage.previewOpener.getHeight() -1 ) + "px"
top: (off.top + theImage.getHeight() - theImage.previewOpener.getHeight() + marginTop) + "px"
});
});
img.observe("mouseout", function(event){
Expand Down
3 changes: 2 additions & 1 deletion core/src/plugins/editor.imagick/class.IMagickPreviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ Class.create("IMagickPreviewer", Diaporama, {
});
}
var off = theImage.positionedOffset();
var marginTop = (theImage.getStyle('marginTop')) ? parseInt(theImage.getStyle('marginTop')) : 0;
var realLeftOffset = Math.max(off.left, theImage.parentNode.positionedOffset().left);
theImage.previewOpener.setStyle({
display:'block',
left: realLeftOffset + 'px',
width:theImage.getWidth() + "px",
top: (off.top + theImage.getHeight() - theImage.previewOpener.getHeight()) + "px"
top: (off.top + theImage.getHeight() - theImage.previewOpener.getHeight() + marginTop) + "px"
});
});
img.observe("mouseout", function(event){
Expand Down

0 comments on commit a850de3

Please sign in to comment.