1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 04:40:44 +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.addClass('media-select-active');
$this.closest('img').addClass('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]'; bbpath = '[file=' + id + ']' + name + '[/file]';
$bbcodeHolder.val(bbpath);
if($bbcodeHolder.length > 0)
{
$bbcodeHolder.val(bbpath);
}
return; return;
} }
if(bbcode == "video" || bbcode == 'glyph') if(bbcode == "video" && $bbcodeHolder.length > 0)
{ {
bbpath = '[' + bbcode + ']' + path + '[/' + bbcode + ']'; 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); $bbcodeHolder.val(bbpath);
} }
} }