From 76990ac1b22be26df9ccd4d1765aa424896458fa Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 29 Mar 2017 11:56:03 +0200 Subject: [PATCH] version toolbar.css for cache-busting --- www/common/toolbar.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 204aaf6f0..ae64c062d 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -1,7 +1,8 @@ define([ '/customize/application_config.js', + '/api/config', '/bower_components/jquery/dist/jquery.min.js' -], function (Config) { +], function (Config, ApiConfig) { var $ = window.jQuery; var Messages = {}; @@ -54,8 +55,9 @@ define([ var firstConnection = true; var lagErrors = 0; - var styleToolbar = function ($container, href) { - href = href || '/customize/toolbar.css'; + var styleToolbar = function ($container, href, version) { + href = href || '/customize/toolbar.css' + (version?('?' + version): ''); + $.ajax({ url: href, dataType: 'text', @@ -80,7 +82,12 @@ define([ } $container.prepend($toolbar); - styleToolbar($container); + + if (ApiConfig && ApiConfig.requireConf && ApiConfig.requireConf.urlArgs) { + styleToolbar($container, undefined, ApiConfig.requireConf.urlArgs); + } else { + styleToolbar($container); + } return $toolbar; };