1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

Fix for issue #2835.

This commit is contained in:
lonalore
2017-10-31 10:19:09 +01:00
parent d7016f9971
commit 5cc14c86ae

View File

@@ -320,23 +320,27 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$this.addClass('media-select-active');
$this.closest('img').addClass('active');
if(bbcode == "file") // not needed for Tinymce
if(bbcode == "file" && $bbcodeHolder.length > 0) // not needed for Tinymce
{
bbpath = '[file=' + id + ']' + name + '[/file]';
if($bbcodeHolder.length > 0)
{
$bbcodeHolder.val(bbpath);
}
$bbcodeHolder.val(bbpath);
return;
}
if(bbcode == "video" || bbcode == 'glyph')
if(bbcode == "video" && $bbcodeHolder.length > 0)
{
bbpath = '[' + bbcode + ']' + path + '[/' + bbcode + ']';
$bbcodeHolder.val(bbpath);
}
if($bbcodeHolder.length > 0)
if(bbcode == "glyph" && $bbcodeHolder.length > 0)
{
var $target = $('div#' + target + "_prev", window.top.document);
// Only if the triggering element is not an icon-picker.
if($target.length == 0 || !$target.hasClass('image-selector'))
{
bbpath = '[' + bbcode + ']' + path + '[/' + bbcode + ']';
$bbcodeHolder.val(bbpath);
}
}