From: soufiane Date: Thu, 31 Jul 2025 12:53:12 +0000 (+0200) Subject: wip #7634 ajout du loader à la sauvegarde X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1d596348d5cf5badeb885594c5a821bd597db9b2;p=fluidbook-toolbox.git wip #7634 ajout du loader à la sauvegarde --- diff --git a/resources/markdowneditor/js/markdowneditor.save.js b/resources/markdowneditor/js/markdowneditor.save.js index fdf369214..f45a9ccfe 100644 --- a/resources/markdowneditor/js/markdowneditor.save.js +++ b/resources/markdowneditor/js/markdowneditor.save.js @@ -56,6 +56,8 @@ MarkdowneditorSave.prototype = { message = TRANSLATIONS.manual_save_message; } + $(".markdown-toolbar-save-block").addClass("is-saving") + $.ajax({ url: '/fluidbook-publication/' + FLUIDBOOK_DATA.id + '/save/markdown', method: 'post', data: { _method: 'put', @@ -77,6 +79,9 @@ MarkdowneditorSave.prototype = { $this.markdowneditor.hasChanged(); $this.markdowneditor.notification(TRANSLATIONS.error_save + ' : ' + error, 'error'); }, + complete: function() { + $(".markdown-toolbar-save-block").removeClass("is-saving") + } }); }, diff --git a/resources/markdowneditor/style/style.sass b/resources/markdowneditor/style/style.sass index 954b6fb7b..34e41b439 100644 --- a/resources/markdowneditor/style/style.sass +++ b/resources/markdowneditor/style/style.sass @@ -143,6 +143,22 @@ body width: 100% display: flex align-items: center + &-save-block + position: relative + min-width: 26px + &.is-saving + [data-icon="save"] + display: none + [data-icon="loading"] + display: block !important + + [data-icon="loading"] + display: none + position: absolute + left: 0 + animation: rotate 1.5s linear infinite + pointer-events: none + &-editor display: flex height: 100vh @@ -254,3 +270,9 @@ input::-webkit-inner-spin-button .ProseMirror, .toastui-editor-md-preview @include tinyscrollbars + +@keyframes rotate + from + transform: rotate(0) + to + transform: rotate(360deg) diff --git a/resources/views/fluidbook_publication/link_editor_icons.blade.php b/resources/views/fluidbook_publication/link_editor_icons.blade.php index df83965ec..a6d7c934b 100644 --- a/resources/views/fluidbook_publication/link_editor_icons.blade.php +++ b/resources/views/fluidbook_publication/link_editor_icons.blade.php @@ -87,6 +87,26 @@ Edit here : https://toolbox.fluidbook.com/tool-sprite/3/edit + + + + + + + + + + + + + + + + + +