Fix contact popup with tinyMCE

Fix #1920
This commit is contained in:
fabrixxm 2015-12-04 18:59:50 +01:00
parent 4e53df7c71
commit f3901b99a2

View file

@ -23,19 +23,20 @@ function ACPopup(elm,backend_url){
var h = 130; var h = 130;
if(typeof elm.editorId == "undefined") { if(tinyMCE.activeEditor == null) {
style = $(elm).offset(); style = $(elm).offset();
w = $(elm).width(); w = $(elm).width();
h = $(elm).height(); h = $(elm).height();
} }
else { else {
var container = elm.getContainer(); // I can't find an "official" way to get the element who get all
if(typeof container != "undefined") { // this fraking thing that is tinyMCE.
// This code will broke again at some point...
var container = $(tinyMCE.activeEditor.getContainer()).find("table");
style = $(container).offset(); style = $(container).offset();
w = $(container).width(); w = $(container).width();
h = $(container).height(); h = $(container).height();
} }
}
style.top=style.top+h; style.top=style.top+h;
style.width = w; style.width = w;