Skip to content

Commit 420b36b

Browse files
committed
Merge pull request #2444 from jeff1evesque/bug-2443
#2443: Resolve travis jshint, and bootlint introduced via #2413
2 parents 35a05a1 + d3ae8a7 commit 420b36b

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ script:
5050
- jshint --verbose src/js/*.js --config test/config/jshint.json --exclude-path test/config/.jshintignore
5151
- jscs . --config test/config/.jscs.json
5252
- scss-lint src/scss/*.scss
53-
- bootlint interface/templates/*.html
53+
- bootlint -d W005 interface/templates/*.html
5454
- puppet-lint --no-ensure_first_param-check --no-autoloader_layout-check --no-variable_scope-check puppet/environment/development/manifests
5555
- puppet-lint --no-ensure_first_param-check --no-variable_scope-check puppet/environment/development/modules
5656
- (cd puppet/environment/development/ && r10k puppetfile check)

src/js/ajax_caller.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,21 @@
77
// AJAX Process
88
function ajaxCaller(callbackDone, callbackFail, args) {
99
// define fetch headers
10-
if (args.contentType === null || args.contentType == undefined) {
11-
var headers = {
10+
var fetchHeaders = {
11+
'Accept': 'text/javascript',
12+
'Content-Type': args.contentType
13+
};
14+
if (args.contentType === null || args.contentType === undefined) {
15+
fetchHeaders = {
1216
'Accept': 'text/javascript'
13-
}
14-
}
15-
else {
16-
var headers = {
17-
'Accept': 'text/javascript',
18-
'Content-Type': args.contentType
19-
}
17+
};
2018
}
2119

2220
// ajax logic
2321
fetch(args.endpoint, {
2422
method: 'post',
2523
body: args.data,
26-
headers: headers
24+
headers: fetchHeaders
2725
}).then(function(response) {
2826
if (response.ok) {
2927
// asynchronous callback
@@ -33,7 +31,7 @@ function ajaxCaller(callbackDone, callbackFail, args) {
3331
var error = {
3432
'statusText': response.statusText,
3533
'status': response.status
36-
}
34+
};
3735
throw error;
3836
}
3937
}).catch(function(e) {

0 commit comments

Comments
 (0)