Fixed smiley issue
authorMarcel Werk <burntime@woltlab.com>
Mon, 24 Feb 2014 02:49:17 +0000 (03:49 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 24 Feb 2014 02:49:17 +0000 (03:49 +0100)
com.woltlab.wcf/templates/__messageFormSmilies.tpl
wcfsetup/install/files/js/WCF.Message.js

index 5efac62bc8fd15bdee3759e598b2ef8fbc0a6467..a4204abebad638b61234debc7f0714339637f597 100644 (file)
@@ -1,5 +1,5 @@
 <ul class="smileyList">
        {foreach from=$smilies item=smiley}
-               <li><a title="{lang}{$smiley->smileyTitle}{/lang}" class="jsTooltip jsSmiley" data-smiley-code="{$smiley->smileyCode}"><img src="{$smiley->getURL()}" alt="{$smiley->smileyCode}" /></a></li>
+               <li><a title="{lang}{$smiley->smileyTitle}{/lang}" class="jsTooltip jsSmiley" data-smiley-code="{$smiley->smileyCode}" data-smiley-path="{$smiley->smileyPath}"><img src="{$smiley->getURL()}" alt="{$smiley->smileyCode}" /></a></li>
        {/foreach}
 </ul>
\ No newline at end of file
index e4927d79f0b2ef4947ae50427d49dd526fd808a7..4644e6de6078a1dfe1367b83e0bb5f01c2745272 100644 (file)
@@ -544,11 +544,10 @@ WCF.Message.Smilies = Class.extend({
        _smileyClick: function(event) {
                var $target = $(event.currentTarget);
                var $smileyCode = $target.data('smileyCode');
+               var $smileyPath = $target.data('smileyPath');
                
                // get ckEditor
                var $ckEditor = this._ckEditor.ckeditorGet();
-               // get smiley path
-               var $smileyPath = $target.find('img').attr('src');
                
                // add smiley to config
                if (!WCF.inArray($smileyCode, $ckEditor.config.smiley_descriptions)) {
@@ -560,7 +559,7 @@ WCF.Message.Smilies = Class.extend({
                        // in design mode
                        var $img = $ckEditor.document.createElement('img', {
                                attributes: {
-                                       src: $smileyPath,
+                                       src: $ckEditor.config.smiley_path + $smileyPath,
                                        'class': 'smiley',
                                        alt: $smileyCode
                                }