Skip to content

Commit 5ca1be7

Browse files
marcgurneyrueckstiess
authored andcommitted
ran 'npm run fmt'
1 parent ef3c723 commit 5ca1be7

File tree

4 files changed

+47
-36
lines changed

4 files changed

+47
-36
lines changed

src/connect/connect-form-view.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ var ConflictingValuesInputView = InputView.extend({
3636
}
3737
}
3838
},
39-
tests: [
40-
function(value) {
41-
if (this.conflicting.indexOf(value) !== -1) {
42-
return 'This name already exists. Please choose another name.';
43-
}
39+
tests: [function(value) {
40+
if (this.conflicting.indexOf(value) !== -1) {
41+
return 'This name already exists. Please choose another name.';
4442
}
43+
}
4544
]
4645
});
4746

src/minicharts/index.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ module.exports = AmpersandView.extend(QueryBuilderMixin, {
6262
/* eslint complexity: 0 */
6363
_geoCoordinateCheck: function() {
6464
var coords;
65-
if (!app.isFeatureEnabled('Geo Minicharts')) return false;
66-
if (!navigator.onLine) return false;
65+
if (!app.isFeatureEnabled('Geo Minicharts')) {
66+
return false;
67+
}
68+
if (!navigator.onLine) {
69+
return false;
70+
}
6771

6872
if (this.model.name === 'Document') {
6973
if (this.model.fields.length !== 2
@@ -72,24 +76,32 @@ module.exports = AmpersandView.extend(QueryBuilderMixin, {
7276
|| this.model.fields.get('type').types.get('String').unique !== 1
7377
|| this.model.fields.get('type').types.get('String').values.at(0).value !== 'Point'
7478
|| this.model.fields.get('coordinates').types.get('Array').count
75-
!== this.model.fields.get('coordinates').count
79+
!== this.model.fields.get('coordinates').count
7680
|| this.model.fields.get('coordinates').types.get('Array').average_length !== 2
77-
) return false;
81+
) {
82+
return false;
83+
}
7884
coords = this._mangleGeoCoordinates(
7985
this.model.fields.get('coordinates').types.get('Array')
80-
.types.get('Number').values.serialize());
81-
if (!coords) return false;
86+
.types.get('Number').values.serialize());
87+
if (!coords) {
88+
return false;
89+
}
8290
// we have a GeoJSON document: {type: "Point", coordinates: [lng, lat]}
8391
this.model.values = coords;
8492
this.model.fields.reset();
8593
this.model.name = 'Coordinates';
8694
return true;
8795
} else if (this.model.name === 'Array') {
8896
var lengths = this.model.lengths;
89-
if (_.min(lengths) !== 2 || _.max(lengths) !== 2) return false;
97+
if (_.min(lengths) !== 2 || _.max(lengths) !== 2) {
98+
return false;
99+
}
90100
coords = this._mangleGeoCoordinates(
91101
this.model.types.get('Number').values.serialize());
92-
if (!coords) return false;
102+
if (!coords) {
103+
return false;
104+
}
93105
// we have a legacy coordinate pair: [lng, lat]
94106
this.model.values = coords;
95107
this.model.types.reset();

src/minicharts/querybuilder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = {
7676
break;
7777
case 'ObjectID': // fall-through to Date
7878
case 'Date':
79-
queryType = 'range';
79+
queryType = 'range';
8080
break;
8181
case 'Array':
8282
case 'Document':
@@ -306,7 +306,7 @@ module.exports = {
306306
// multiple values
307307
message.value = new GeoOperator({
308308
$geoWithin: {
309-
$centerSphere: [ [message.selected[0], message.selected[1] ], message.selected[2] ]
309+
$centerSphere: [[message.selected[0], message.selected[1]], message.selected[2]]
310310
}
311311
}, {
312312
parse: true

src/tour/index.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ var TourView = View.extend({
2828
this.$tourRemove = this.query('#tour-remove');
2929
},
3030
showHidePreviousNextButtons: function() {
31-
if(this.tourCount === 0) {
31+
if (this.tourCount === 0) {
3232
$('.previous-slide').addClass('hide');
3333
} else {
3434
$('.previous-slide').removeClass('hide');
3535
}
3636

37-
if(this.tourCount === 4) {
37+
if (this.tourCount === 4) {
3838
$('.next-slide').addClass('hide');
3939
$('#tour-remove').removeClass('hide');
4040
} else {
@@ -44,17 +44,17 @@ var TourView = View.extend({
4444
},
4545
showFeature: function(ev) {
4646
var nCLick = ev.target.getAttribute('data-n'),
47-
that = this;
48-
47+
that = this;
48+
4949
if (nCLick === null) {
5050
return false;
5151
}
5252
var nFeature = parseInt(nCLick, 10);
53-
53+
5454
// deselect old
5555
$('#features li.selected').removeClass('selected');
5656
$('.feature-content.active').removeClass('active');
57-
57+
5858
// select new
5959
ev.target.className = 'selected';
6060

@@ -63,21 +63,21 @@ var TourView = View.extend({
6363
$('#animation-gif').css('opacity', '1');
6464
});
6565
$('#animation-gif').css('opacity', '0');
66-
66+
6767
$('.feature-content#f' + nFeature + '-content').addClass('active');
68-
68+
6969
this.tourCount = nFeature;
7070
this.showHidePreviousNextButtons();
7171
},
72-
showPreviousFeature: function(ev) {
72+
showPreviousFeature: function() {
7373
var currentFeature = this.tourCount,
74-
previousFeature = this.tourCount - 1,
75-
that = this;
76-
74+
previousFeature = this.tourCount - 1,
75+
that = this;
76+
7777
// deselect old
7878
$('#features li.selected').removeClass('selected');
7979
$('.feature-content.active').removeClass('active');
80-
80+
8181
// select new
8282
$('#features li#f' + previousFeature).addClass('selected');
8383

@@ -86,30 +86,30 @@ var TourView = View.extend({
8686
$('#animation-gif').css('opacity', '1');
8787
});
8888
$('#animation-gif').css('opacity', '0');
89-
89+
9090
$('.feature-content#f' + previousFeature + '-content').addClass('active');
9191

9292
this.tourCount = previousFeature;
9393
this.showHidePreviousNextButtons();
9494
},
95-
showNextFeature: function(ev) {
95+
showNextFeature: function() {
9696
var currentFeature = this.tourCount,
97-
nextFeature = this.tourCount + 1,
98-
that = this;
99-
97+
nextFeature = this.tourCount + 1,
98+
that = this;
99+
100100
// deselect old
101101
$('#features li.selected').removeClass('selected');
102102
$('.feature-content.active').removeClass('active');
103-
103+
104104
// select new
105105
$('#features li#f' + nextFeature).addClass('selected');
106-
106+
107107
$('#animation-gif').one('webkitTransitionEnd', function(event) {
108108
that.$animationGIF.src = that.tourImagesFolder + 'f' + nextFeature + '.gif';
109109
$('#animation-gif').css('opacity', '1');
110110
});
111111
$('#animation-gif').css('opacity', '0');
112-
112+
113113
$('.feature-content#f' + nextFeature + '-content').addClass('active');
114114

115115
this.tourCount = nextFeature;

0 commit comments

Comments
 (0)