File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const EVENT_STOP = `stop${EVENT_KEY}`
24
24
const EVENT_CLICK_DATA_API = `click${ EVENT_KEY } ${ DATA_API_KEY } `
25
25
26
26
const CLASS_NAME_IS_LOADING = 'is-loading'
27
+ const CLASS_NAME_LOADING_BUTTON = 'btn-loading'
27
28
const CLASS_NAME_LOADING_BUTTON_SPINNER = 'btn-loading-spinner'
28
29
29
30
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="loading-button"]'
@@ -58,6 +59,8 @@ class LoadingButton extends BaseComponent {
58
59
if ( this . _element ) {
59
60
Data . set ( element , DATA_KEY , this )
60
61
}
62
+
63
+ this . _createButton ( )
61
64
}
62
65
63
66
// Getters
@@ -124,6 +127,10 @@ class LoadingButton extends BaseComponent {
124
127
this . _element = null
125
128
}
126
129
130
+ _createButton ( ) {
131
+ this . _element . classList . add ( CLASS_NAME_LOADING_BUTTON )
132
+ }
133
+
127
134
_createSpinner ( ) {
128
135
if ( this . _config . spinner ) {
129
136
const spinner = document . createElement ( 'span' )
You can’t perform that action at this time.
0 commit comments