Closed pennstatephil closed 9 years ago
That script used to be in the Bootstrap.js file. They might have pulled it out for performance reasons. I'll check.
it does look like there's something going on in the bootstrap.js (the button.js section) but I don't see anything about data-loading-text... you're probably right about the performance thing. If you look at the example on the site (http://getbootstrap.com/javascript/#buttons) it appears that you need additional code to initialize it now...
<button type="button" id="loading-example-btn" data-loading-text="Loading..." class="btn btn-primary">
Loading state
</button>
<script>
$('#loading-example-btn').click(function () {
var btn = $(this)
btn.button('loading')
$.ajax(...).always(function () {
btn.button('reset')
});
});
</script>
I would say it's your call whether to implement this in TBMVC js or leave it to the user to manually initialize the way the example suggests...
ETA: Actually it's even easier than all that: $('.btn').button()
This is in the latest JavaScript. Thanks for research!
Using the
LoadingText()
extension on buttons successfully adds thedata-loading-text
element to the button, but there is no javascript in TwitterBootstrapMvcJs.js to actually change the text.