… and always reload the media list page in the ACP after editing/replacing media file to ensure updated data.
deleteAction.setCallback(this._deleteCallback);
_mediaEditor = new MediaEditor({
- _editorSuccess: function(media, oldCategoryId) {
- if (media.categoryID != oldCategoryId) {
+ _editorSuccess: function(media, oldCategoryId, closedEditorDialog = true) {
+ if (media.categoryID != oldCategoryId || closedEditorDialog) {
window.setTimeout(function() {
window.location.reload();
}, 500);
*/
updateData: function(data) {
if (this._callbackObject._editorSuccess) {
- this._callbackObject._editorSuccess(data);
+ this._callbackObject._editorSuccess(data, undefined, false);
}
}
};
*
* @param {object} media updated media file data
* @param {integer} oldCategoryId old category id
+ * @param {boolean} closedEditorDialog
*/
- _editorSuccess: function(media, oldCategoryId) {
+ _editorSuccess: function(media, oldCategoryId, closedEditorDialog = true) {
// if the category changed of media changed and category
// is selected, check if media list needs to be refreshed
if (this._mediaCategorySelect) {
}
}
- UiDialog.open(this);
+ if (closedEditorDialog) {
+ UiDialog.open(this);
+ }
this._media.set(~~media.mediaID, media);
* @author Matthias Schmidt
* @copyright 2001-2020 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLabSuite/Core/Media/Upload
+ * @module WoltLabSuite/Core/Media/Replace
* @since 5.3
*/
define(