From 4f22cfdd2b5b08a9ecab209491b8e5a7ce937964 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 13 Jul 2013 20:21:40 +0200 Subject: [PATCH] Fixed attachment insert on mobile devices --- wcfsetup/install/files/js/WCF.Attachment.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.20.1