From 6cb8be73256955d5c2ffca3fd83f4752ac30de4f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 24 Nov 2014 13:05:26 +0100 Subject: [PATCH] Fixed a few issues related to attachment management --- wcfsetup/install/files/js/WCF.Attachment.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Attachment.js b/wcfsetup/install/files/js/WCF.Attachment.js index 6c1e48d261..fcc66a13cd 100644 --- a/wcfsetup/install/files/js/WCF.Attachment.js +++ b/wcfsetup/install/files/js/WCF.Attachment.js @@ -187,9 +187,12 @@ WCF.Attachment.Upload = WCF.Upload.extend({ this._buttonSelector.next('small.innerError').remove(); } - if (!this._fileListSelector.children('li:not(.uploadFailed)').length) { + var $listItems = this._fileListSelector.children(); + if (!$listItems.filter(':not(.uploadFailed)').length) { this._insertAllButton.hide(); - + } + + if (!$listItems.length) { setTimeout((function() { if (!this._fileListSelector.children('li:not(.uploadFailed)').length) { this._fileListSelector.wcfBlindOut(); @@ -304,7 +307,7 @@ WCF.Attachment.Upload = WCF.Upload.extend({ $li.find('small').append(data.returnValues.attachments[$internalFileID]['formattedFilesize']); // init buttons - var $buttonList = $li.find('ul'); + var $buttonList = $li.find('ul').addClass('buttonGroup'); var $deleteButton = $('
  • ' + WCF.Language.get('wcf.global.button.delete') + '
  • '); $buttonList.append($deleteButton); @@ -312,11 +315,11 @@ WCF.Attachment.Upload = WCF.Upload.extend({ if (this._wysiwygContainerID) { if (data.returnValues.attachments[$internalFileID].tinyURL) { - var $insertThumbnail = $('
  • ' + WCF.Language.get('wcf.attachment.insertThumbnail') + '
  • '); - var $insertOriginal = $('
  • ' + WCF.Language.get('wcf.attachment.insertFull') + '
  • '); + var $insertThumbnail = $('
  • ' + WCF.Language.get('wcf.attachment.insertThumbnail') + '
  • ').appendTo($buttonList); + var $insertOriginal = $('
  • ' + WCF.Language.get('wcf.attachment.insertFull') + '
  • ').appendTo($buttonList); - $insertThumbnail.children('span.button').click($.proxy(this._insert, this)).appendTo($buttonList); - $insertOriginal.children('span.button').click($.proxy(this._insert, this)).appendTo($buttonList); + $insertThumbnail.children('span.button').click($.proxy(this._insert, this)); + $insertOriginal.children('span.button').click($.proxy(this._insert, this)); } else { var $insertPlain = $('
  • ' + WCF.Language.get('wcf.attachment.insert') + '
  • '); -- 2.20.1