Skip to content

Commit 6e4581b

Browse files
committed
fix ability to disable the progress bar
1 parent 99307bd commit 6e4581b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

models/scripts.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<cfoutput>
22
<!-- CBWIRE SCRIPTS -->
3-
<script src="#getEvent().getModuleRoot( 'cbwire' )#/includes/js/livewire.js?id=239a5c52" data-csrf="#generateCSRFToken()#" data-update-uri="#getUpdateEndpoint()#" data-navigate-once="true"></script>
3+
<script src="#getEvent().getModuleRoot( 'cbwire' )#/includes/js/livewire.js?id=239a5c52" <cfif not moduleSettings.showProgressBar>data-no-progress-bar</cfif> data-csrf="#generateCSRFToken()#" data-update-uri="#getUpdateEndpoint()#" data-navigate-once="true"></script>
44

55
<script data-navigate-once="true">
66
document.addEventListener('livewire:init', () => {

test-harness/tests/specs/CBWIRESpec.cfc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@ component extends="coldbox.system.testing.BaseTestCase" {
5555
expect( html ).toInclude( "--livewire-progress-bar-color: ##cc0000;" );
5656
} );
5757

58+
it( "should show the progress bar by default", function() {
59+
var CBWIREController = getInstance( "CBWIREController@cbwire" );
60+
var html = CBWIREController.getScripts();
61+
expect( html ).notToInclude( " data-no-progress-bar " );
62+
} );
63+
64+
it( "should be able to disable the progress bar", function() {
65+
var CBWIREController = getInstance( "CBWIREController@cbwire" );
66+
var settings = getInstance( "coldbox:modulesettings:cbwire" );
67+
settings.showProgressBar = false;
68+
var html = CBWIREController.getScripts();
69+
expect( html ).toInclude( " data-no-progress-bar " );
70+
} );
71+
5872
it( "should have default updateEndpoint", function() {
5973
var CBWIREController = getInstance( "CBWIREController@cbwire" );
6074
var settings = getInstance( "coldbox:modulesettings:cbwire" );

0 commit comments

Comments
 (0)