Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Ensure that loadingState element is being found
Browse files Browse the repository at this point in the history
The initial test mock didn't take into consideration whether the button
state change was being applied to any elements or not. Now it checks
whether any elements are targeted and if it then applies the new state.
  • Loading branch information
gaqzi committed Apr 7, 2014
1 parent cdfb262 commit 384cc93
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flight-tower",
"version": "1.0.0rc1",
"version": "1.0.0rc2",
"dependencies": {
"flight": "~1.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions lib/with_bootstrap_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ define(function(require) {

if(options.toggleLoadingState) {
this.on('formSubmitStart', function() {
this.select('bootstrapFormSubmitSelector')
this.$node.find(options.bootstrapFormSubmitSelector)
.button('loading');
});

this.on('formSubmitEnd', function() {
this.select('bootstrapFormSubmitSelector')
this.$node.find(options.bootstrapFormSubmitSelector)
.button('reset');
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flight-tower",
"version": "1.0.0rc1",
"version": "1.0.0rc2",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-bump": "latest",
Expand Down
4 changes: 3 additions & 1 deletion test/spec/with_bootstrap_form.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ describeMixin('lib/with_bootstrap_form', function () {
beforeEach(function() {
button = false;
$.fn.button = function(arg) {
button = arg;
if(this.size() > 0) {
button = arg;
}
};
});

Expand Down

0 comments on commit 384cc93

Please sign in to comment.