From: Alexander Ebert Date: Sat, 13 Jul 2013 18:21:40 +0000 (+0200) Subject: Fixed attachment insert on mobile devices X-Git-Tag: 2.0.0_Beta_5~52 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4f22cfdd2b5b08a9ecab209491b8e5a7ce937964;p=GitHub%2FWoltLab%2FWCF.git Fixed attachment insert on mobile devices --- diff --git a/wcfsetup/install/files/js/WCF.Attachment.js b/wcfsetup/install/files/js/WCF.Attachment.js index e558047b0a..5ca158c249 100644 --- a/wcfsetup/install/files/js/WCF.Attachment.js +++ b/wcfsetup/install/files/js/WCF.Attachment.js @@ -238,14 +238,14 @@ WCF.Attachment.Upload = WCF.Upload.extend({ var $attachmentID = $(event.currentTarget).data('objectID'); var $bbcode = '[attach=' + $attachmentID + '][/attach]'; - var $ckEditor = $('#' + this._wysiwygContainerID).ckeditorGet(); - if ($ckEditor.mode === 'wysiwyg') { + var $ckEditor = ($.browser.mobile) ? null : $('#' + this._wysiwygContainerID).ckeditorGet(); + if ($ckEditor !== null && $ckEditor.mode === 'wysiwyg') { // in design mode $ckEditor.insertText($bbcode); } else { // in source mode - var $textarea = $('#' + this._wysiwygContainerID).next('.cke_editor_text').find('textarea'); + var $textarea = ($.browser.mobile) ? $('#' + this._wysiwygContainerID) : $('#' + this._wysiwygContainerID).next('.cke_editor_text').find('textarea'); var $value = $textarea.val(); if ($value.length == 0) { $textarea.val($bbcode);