From 77f3d45e9d80dbcbfc62a6c8c14e385eadcf4727 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 22 Sep 2015 15:57:50 +0000 Subject: [PATCH] After changing the template and it's loaded, refresh. Fixes a bug where new users did not see the results in the new view the first time (not caused by template caching though) --- filemanager/js/app.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/filemanager/js/app.js b/filemanager/js/app.js index 1141456fcf..1f6f0c7a6f 100644 --- a/filemanager/js/app.js +++ b/filemanager/js/app.js @@ -725,7 +725,17 @@ app.classes.filemanager = AppJS.extend( nm.activeFilters.view = view; // Change template to match - nm.set_template(view == nm.controller.VIEW_ROW ? 'filemanager.index.rows' : 'filemanager.tile'); + var template = view == nm.controller.VIEW_ROW ? 'filemanager.index.rows' : 'filemanager.tile'; + nm.set_template(template); + + // Wait for template to load, then refresh + template = nm.getWidgetById(template); + if(template && template.loading) + { + template.loading.done(function() { + nm.applyFilters({view: view}); + }) + } }, /**