1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

fixes #3051 broken image links

The image browser always returns image path relative to admin directory,
which doesn't work in case the target is a plugin.
Added a check for the target and modify the preview url in case
it is a plugin.
This commit is contained in:
Achim Ennenbach
2018-07-04 13:28:45 +02:00
parent 89e3716c3f
commit d8c63724b2
2 changed files with 12 additions and 0 deletions

View File

@@ -395,6 +395,14 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
{
preview = $htmlHolder.val();
}
// issue #3051 Preview url is wrong when target page is a plugin
var s = new RegExp('/' + e107_plugins_directory + '[\\w]+/', 'gmi');
if (window.top.document.URL.match(s))
{
preview = preview.replace(e107_plugins_directory, '');
}
}
$('div#' + target + "_prev", window.top.document).html(preview); // set new value