diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index c568a3051..df6c5b667 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -102,27 +102,11 @@ function animateLoading(start){ * Shows spinner if start is true or not given, hides it if false. * Optional parameter options for spin.js options. */ -function animateSpinner(el, start, options) { +function animateSpinner(el, start) { // If overlaying the whole page, put the spinner in the middle of the page - var overlayPage = false; - if (_.isUndefined(el) || el === null) { - overlayPage = true; - if ($(document.body).has('.loading-overlay-center').length === 0) { - $(document.body).append('
'); - } - el = $(document.body).find('.loading-overlay-center'); - } + var overlayPage = _.isUndefined(el) || el === null; - if (_.isUndefined(start)) { - start = true; - } - - if (start && options) { - $(el).spin(options); - } - else { - $(el).spin(start); - } + if (_.isUndefined(start)) start = true; if (start) { if (overlayPage) { diff --git a/app/assets/stylesheets/shared/assets.scss b/app/assets/stylesheets/shared/assets.scss index 21e0ec4fc..3bf39918c 100644 --- a/app/assets/stylesheets/shared/assets.scss +++ b/app/assets/stylesheets/shared/assets.scss @@ -25,7 +25,7 @@ width: 100%; &.processing { - background-image: url("/images/medium/processing.gif"); + background-image: url("/images/medium/loading.svg"); background-position: center; background-repeat: no-repeat; } diff --git a/app/assets/stylesheets/shared/file_preview.scss b/app/assets/stylesheets/shared/file_preview.scss index ca255ef3d..a0aa8276a 100644 --- a/app/assets/stylesheets/shared/file_preview.scss +++ b/app/assets/stylesheets/shared/file_preview.scss @@ -31,9 +31,10 @@ width: 100%; &.processing { - background-image: url("/images/medium/processing.gif"); + background-image: url("/images/medium/loading_white.svg"); background-position: center; background-repeat: no-repeat; + background-size: 64px; } .wopi-file-preview { diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index 3b27f3926..45b352513 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -1256,20 +1256,34 @@ ul.content-activities { /* Overlay to disable interaction while loading ajax */ .loading-overlay { - position: fixed; - top: 0; - left: 0; - right: 0; bottom: 0; - z-index: 1000000000; cursor: wait; -} - -.loading-overlay-center { - position: fixed; - left:50%; - top:50%; + left: 0; + position: absolute; + right: 0; + top: 0; z-index: 1000000000; + + &::before { + background: $color-white; + content: ""; + display: block; + height: 100%; + opacity: .5; + width: 100%; + } + + &::after { + background-image: url("/images/medium/loading.svg"); + background-position: center; + background-repeat: no-repeat; + content: ""; + display: block; + height: 100%; + position: absolute; + top: 0; + width: 100%; + } } .turbolinks-progress-bar::before { diff --git a/public/images/medium/loading.svg b/public/images/medium/loading.svg new file mode 100644 index 000000000..338af0e24 --- /dev/null +++ b/public/images/medium/loading.svg @@ -0,0 +1,42 @@ + diff --git a/public/images/medium/loading_white.svg b/public/images/medium/loading_white.svg new file mode 100644 index 000000000..c3a97bb40 --- /dev/null +++ b/public/images/medium/loading_white.svg @@ -0,0 +1,42 @@ +