From: Matthias Schmidt Date: Sun, 8 Sep 2019 14:17:20 +0000 (+0200) Subject: Properly disable attachment insertion button(s) on contact form X-Git-Tag: 5.2.0_Beta_2~71 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a032ebd1539cc058aa9a1b51ac973ffea9abd69a;p=GitHub%2FWoltLab%2FWCF.git Properly disable attachment insertion button(s) on contact form See #2687 --- diff --git a/com.woltlab.wcf/templates/contact.tpl b/com.woltlab.wcf/templates/contact.tpl index a036f6ea3f..368a5b5990 100644 --- a/com.woltlab.wcf/templates/contact.tpl +++ b/com.woltlab.wcf/templates/contact.tpl @@ -73,7 +73,7 @@ {if CONTACT_FORM_ENABLE_ATTACHMENTS && !$attachmentHandler|empty && $attachmentHandler->canUpload()}
- {include file='messageFormAttachments'} + {include file='messageFormAttachments' wysiwygSelector=''}
{/if} diff --git a/wcfsetup/install/files/js/WCF.Attachment.js b/wcfsetup/install/files/js/WCF.Attachment.js index a653f0888e..9c38650728 100644 --- a/wcfsetup/install/files/js/WCF.Attachment.js +++ b/wcfsetup/install/files/js/WCF.Attachment.js @@ -93,14 +93,18 @@ if (COMPILER_TARGET_DEFAULT) { this._makeSortable(); - this._insertAllButton = $('

' + WCF.Language.get('wcf.attachment.insertAll') + '

').hide().appendTo(this._buttonSelector); - this._insertAllButton.click($.proxy(this._insertAll, this)); - - if (this._fileListSelector.children('li:not(.uploadFailed)').length) { - this._insertAllButton.show(); - } + // for backwards compatibility, the object is still created but only inserted + // if an editor is used + this._insertAllButton = $('

' + WCF.Language.get('wcf.attachment.insertAll') + '

').hide(); if (this._editorId) { + this._insertAllButton.appendTo(this._buttonSelector); + this._insertAllButton.click($.proxy(this._insertAll, this)); + + if (this._fileListSelector.children('li:not(.uploadFailed)').length) { + this._insertAllButton.show(); + } + WCF.System.Event.addListener('com.woltlab.wcf.redactor2', 'submit_' + this._editorId, this._submitInline.bind(this)); WCF.System.Event.addListener('com.woltlab.wcf.redactor2', 'reset_' + this._editorId, this._reset.bind(this)); WCF.System.Event.addListener('com.woltlab.wcf.redactor2', 'dragAndDrop_' + this._editorId, this._editorUpload.bind(this)); diff --git a/wcfsetup/install/files/style/ui/contact.scss b/wcfsetup/install/files/style/ui/contact.scss index cfb80b7adc..81758d3833 100644 --- a/wcfsetup/install/files/style/ui/contact.scss +++ b/wcfsetup/install/files/style/ui/contact.scss @@ -1,10 +1,3 @@ .contactFormAttachments { margin-top: 20px; - - .jsButtonAttachmentInsertFull, - .jsButtonAttachmentInsertPlain, - .jsButtonAttachmentInsertThumbnail, - .jsButtonAttachmentInsertAll { - display: none; - } }