Skip to content

Commit

Permalink
Fixed window-position in long lists (fixes #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
psi-4ward committed Oct 27, 2016
1 parent 46d90a0 commit f6c4c8c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions html/TableWizard4ward.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,16 @@ var TableWizard4ward = new Class({
tinyMCE.activeEditor.focus();

// set RTE position
var left = e.event.clientX - 289 + document.body.getScroll().x;
var top = e.event.clientY - 155 + document.body.getScroll().y;
var scroll = document.body.getScroll();
var left = e.event.clientX - 289 + scroll.x;
var top = e.event.clientY - 155 + scroll.y;
var mbDivSize = this.mbDiv.getSize();
var winSize = window.getSize();

if(top + mbDivSize.y + 10 > winSize.y) top = winSize.y - mbDivSize.y - 10;
else if(top < document.body.getScroll().y + 10) top = document.body.getScroll().y + 10;
if(top + mbDivSize.y + 10 > winSize.y + scroll.y) top = winSize.y - mbDivSize.y - 10 + scroll.y;
else if(top < scroll.y + 10) top = scroll.y + 10;
if(left + mbDivSize.x + 10 > winSize.x) left = winSize.x - mbDivSize.x - 10;
else if(left < document.body.getScroll().x + 10) left = document.body.getScroll().x + 10;
else if(left < scroll.x + 10) left = scroll.x + 10;

this.mbDiv.setStyle('left', left);
this.mbDiv.setStyle('top', top);
Expand Down Expand Up @@ -223,7 +224,7 @@ TableWizard4ward.tableWizard = function(el, command, id)
index++;
}

if(Backend != null) Backend.getScrollOffset();
// if(Backend != null) Backend.getScrollOffset();

switch(command) {
case 'rnew':
Expand Down

0 comments on commit f6c4c8c

Please sign in to comment.