commit e6345fab7c09b995dfdfd3a582337d80f96740d0
parent f3ce21708a13723f965a7d288c350087c075bc36
Author: Jan Dankert <develop@jandankert.de>
Date: Fri, 7 Feb 2020 23:51:32 +0100
New: Avoid a flackering UI while loading new view: The old view is still displayed in a loading state until the new view is fully loaded.
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/cms-ui/themes/default/script/openrat/view.js b/modules/cms-ui/themes/default/script/openrat/view.js
@@ -49,14 +49,14 @@ Openrat.View = function( action,method,id,params ) {
let loadViewHtmlPromise = $.ajax( url );
- $(this.element).empty().fadeTo(1,0.7).addClass('loader');
+ $(this.element).addClass('loader');
loadViewHtmlPromise.done( function(data,status){
- $(element).html(data);
- $(element).fadeTo(350,1);
+ if ( ! data )
+ data = '';
- $(element).removeClass("loader");
+ $(element).html(data).removeClass("loader");
$(element).find('form').each( function() {
let form = new Openrat.Form();