Modifications pour le document DiagramEditSheet
Modifié par Admin le 19/03/2025 - 19:24
Résumé
-
Objets (1 modifications, 0 ajouts, 0 suppressions)
Détails
- XWiki.JavaScriptExtension[1]
-
- Code
-
... ... @@ -78,8 +78,7 @@ 78 78 79 79 var saveBlobAsImageAttachment = function(blob, fileName, documentReference) { 80 80 var attachmentReference = new XWiki.AttachmentReference(fileName, documentReference); 81 - var uploadMethod = (diagramConfig.isTemporaryUploadSupported) ? xutils.temporaryUploadAttachment : xutils.uploadAttachment; 82 - var uploadAttachment = $.proxy(uploadMethod, null, blob, attachmentReference); 81 + var uploadAttachment = $.proxy(xutils.uploadAttachment, null, blob, attachmentReference); 83 83 // Avoid creating too many versions of the attachment. Upload the attachment even if we failed to delete it first. 84 84 return xutils.deleteAttachment(attachmentReference).then(uploadAttachment, uploadAttachment); 85 85 }; ... ... @@ -147,8 +147,8 @@ 147 147 $(document).on('xwiki:actions:beforeSave', function(event, data) { 148 148 if (!uploadInProgress) { 149 149 uploadInProgress = true; 150 - event. stopPropagation();151 - var saveButton = $(eve nt.target);149 + event.preventDefault(); 150 + var saveButton = $('input[name=action_save' + (data && data['continue'] ? 'andcontinue' : '') + ']'); 152 152 saveButton.prop('disabled', true); 153 153 saveFilesAsImageAttachments().fail(function(e) { 154 154 new XWiki.widgets.Notification(