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:
@@ -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
|
||||
|
Reference in New Issue
Block a user