diff --git a/ModuleConfig.cfc b/ModuleConfig.cfc index b9e2a693..3b19f9c4 100644 --- a/ModuleConfig.cfc +++ b/ModuleConfig.cfc @@ -38,7 +38,15 @@ component { /** * Trims string properties if set to true */ - "trimStringValues" : false + "trimStringValues" : false, + /** + * Enables or disables the progress bar when using wire:navigate + */ + "showProgressBar": true, + /** + * The color of the progress bar when using wire:navigate + */ + "progressBarColor": "##2299dd" }; routes = [ diff --git a/models/CBWIREController.cfc b/models/CBWIREController.cfc index 98eede83..de873c7d 100644 --- a/models/CBWIREController.cfc +++ b/models/CBWIREController.cfc @@ -354,8 +354,8 @@ component singleton { * * @return string */ - function getStyles() { - if (structKeyExists(variables, "styles")) { + function getStyles( cache=true ) { + if (structKeyExists(variables, "styles") && arguments.cache ) { return variables.styles; } diff --git a/models/styles.cfm b/models/styles.cfm index 29fb930d..1b81d0ab 100644 --- a/models/styles.cfm +++ b/models/styles.cfm @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/test-harness/tests/specs/CBWIRESpec.cfc b/test-harness/tests/specs/CBWIRESpec.cfc index 48643af3..04d1ce16 100644 --- a/test-harness/tests/specs/CBWIRESpec.cfc +++ b/test-harness/tests/specs/CBWIRESpec.cfc @@ -41,6 +41,20 @@ component extends="coldbox.system.testing.BaseTestCase" { expect( reMatchNoCase( "CBWIRE Scripts", html ).len() ).toBe( 0 ); } ); + it( "should use default display bar color", function() { + var CBWIREController = getInstance( "CBWIREController@cbwire" ); + var html = CBWIREController.getStyles( cache=false ); + expect( html ).toInclude( "--livewire-progress-bar-color: ##2299dd;" ); + } ); + + it( "should be able to change the display bar color", function() { + var CBWIREController = getInstance( "CBWIREController@cbwire" ); + var settings = getInstance( "coldbox:modulesettings:cbwire" ); + settings.progressBarColor = "##cc0000"; + var html = CBWIREController.getStyles( cache=false ); + expect( html ).toInclude( "--livewire-progress-bar-color: ##cc0000;" ); + } ); + it( "should have default updateEndpoint", function() { var CBWIREController = getInstance( "CBWIREController@cbwire" ); var settings = getInstance( "coldbox:modulesettings:cbwire" );