Commit d03ac54c authored by Valentin Hervieu's avatar Valentin Hervieu

Apply editorconfig formatting

parent a7c7f0e3
......@@ -71,16 +71,17 @@ module.exports = function(grunt) {
replace: {
dist: {
options: {
patterns: [
{
patterns: [{
match: /\/\*templateReplacement\*\//,
replacement: '<%= grunt.file.read("temp/templates.js") %>'
}
]
}]
},
files: [
{expand: true, flatten: true, src: ['src/rzslider.js'], dest: 'dist/'}
]
files: [{
expand: true,
flatten: true,
src: ['src/rzslider.js'],
dest: 'dist/'
}]
}
},
......@@ -94,8 +95,7 @@ module.exports = function(grunt) {
}, {
expand: true,
src: ['dist/rzslider.js']
}
]
}]
}
},
watch: {
......
......@@ -368,8 +368,7 @@
this.customTrFn = function(value) {
return this.options.stepsArray[value];
};
}
else if (this.options.translate)
} else if (this.options.translate)
this.customTrFn = this.options.translate;
else
this.customTrFn = function(value) {
......@@ -505,8 +504,7 @@
setDisabledState: function() {
if (this.options.disabled) {
this.sliderElem.attr('disabled', 'disabled');
}
else {
} else {
this.sliderElem.attr('disabled', null);
}
},
......@@ -802,13 +800,13 @@
* @returns {undefined}
*/
shFloorCeil: function() {
var flHidden = false, clHidden = false;
var flHidden = false,
clHidden = false;
if (this.minLab.rzsl <= this.flrLab.rzsl + this.flrLab.rzsw + 5) {
flHidden = true;
this.hideEl(this.flrLab);
}
else {
} else {
flHidden = false;
this.showEl(this.flrLab);
}
......@@ -816,8 +814,7 @@
if (this.minLab.rzsl + this.minLab.rzsw >= this.ceilLab.rzsl - this.handleHalfWidth - 10) {
clHidden = true;
this.hideEl(this.ceilLab);
}
else {
} else {
clHidden = false;
this.showEl(this.ceilLab);
}
......@@ -825,16 +822,14 @@
if (this.range) {
if (this.maxLab.rzsl + this.maxLab.rzsw >= this.ceilLab.rzsl - 10) {
this.hideEl(this.ceilLab);
}
else if (!clHidden) {
} else if (!clHidden) {
this.showEl(this.ceilLab);
}
// Hide or show floor label
if (this.maxLab.rzsl <= this.flrLab.rzsl + this.flrLab.rzsw + this.handleHalfWidth) {
this.hideEl(this.flrLab);
}
else if (!flHidden) {
} else if (!flHidden) {
this.showEl(this.flrLab);
}
}
......@@ -867,8 +862,7 @@
this.hideEl(this.minLab);
this.hideEl(this.maxLab);
this.showEl(this.cmbLab);
}
else {
} else {
this.showEl(this.maxLab);
this.showEl(this.minLab);
this.hideEl(this.cmbLab);
......@@ -906,7 +900,9 @@
* @returns {jqLite} The jqLite wrapped DOM element
*/
hideEl: function(element) {
return element.css({opacity: 0});
return element.css({
opacity: 0
});
},
/**
......@@ -920,7 +916,9 @@
return element;
}
return element.css({opacity: 1});
return element.css({
opacity: 1
});
},
/**
......@@ -932,7 +930,9 @@
*/
setLeft: function(elem, left) {
elem.rzsl = left;
elem.css({left: left + 'px'});
elem.css({
left: left + 'px'
});
return left;
},
......@@ -957,7 +957,9 @@
*/
setWidth: function(elem, width) {
elem.rzsw = width;
elem.css({width: width + 'px'});
elem.css({
width: width + 'px'
});
return width;
},
......@@ -1007,8 +1009,7 @@
}
return event.originalEvent === undefined ?
event.touches[0].clientX
: event.originalEvent.touches[0].clientX;
event.touches[0].clientX : event.originalEvent.touches[0].clientX;
},
/**
......@@ -1038,8 +1039,7 @@
barTracking = 'rzSliderDrag';
barStart = this.onDragStart;
barMove = this.onDragMove;
}
else {
} else {
barTracking = 'rzSliderModel';
barStart = this.onStart;
barMove = this.onMove;
......@@ -1106,8 +1106,7 @@
if (pointer) {
this.tracking = ref;
}
else {
} else {
pointer = this.getNearestHandle(event);
this.tracking = pointer === this.minH ? 'rzSliderModel' : 'rzSliderHigh';
}
......@@ -1141,14 +1140,12 @@
return;
newValue = this.minValue;
newOffset = 0;
}
else if (newOffset >= this.maxLeft) {
} else if (newOffset >= this.maxLeft) {
if (pointer.rzsl === this.maxLeft)
return;
newValue = this.maxValue;
newOffset = this.maxLeft;
}
else {
} else {
newValue = this.offsetToValue(newOffset);
newValue = this.roundStep(newValue);
newOffset = this.valueToOffset(newValue);
......@@ -1204,8 +1201,7 @@
newMinOffset = 0;
newMaxValue = this.minValue + this.dragging.difference;
newMaxOffset = this.valueToOffset(newMaxValue);
}
else if (newOffset >= this.maxLeft - this.dragging.highDist) {
} else if (newOffset >= this.maxLeft - this.dragging.highDist) {
if (pointer.rzsl === this.dragging.highDist) {
return;
}
......@@ -1213,8 +1209,7 @@
newMaxOffset = this.maxLeft;
newMinValue = this.maxValue - this.dragging.difference;
newMinOffset = this.valueToOffset(newMinValue);
}
else {
} else {
newMinValue = this.offsetToValue(newOffset - this.dragging.lowDist);
newMinValue = this.roundStep(newMinValue);
newMinOffset = this.valueToOffset(newMinValue);
......@@ -1260,8 +1255,7 @@
/* We need to apply here because we are not sure that we will enter the next block */
this.scope.$apply();
this.callOnChange();
}
else if (this.tracking === 'rzSliderHigh' && newValue <= this.scope.rzSliderModel) {
} else if (this.tracking === 'rzSliderHigh' && newValue <= this.scope.rzSliderModel) {
this.scope[this.tracking] = this.scope.rzSliderModel;
this.updateHandles(this.tracking, this.minH.rzsl);
this.tracking = 'rzSliderModel';
......@@ -1311,13 +1305,15 @@
* @return {{moveEvent: string, endEvent: string}}
*/
getEventNames: function(event) {
var eventNames = {moveEvent: '', endEvent: ''};
var eventNames = {
moveEvent: '',
endEvent: ''
};
if (event.touches || (event.originalEvent !== undefined && event.originalEvent.touches)) {
eventNames.moveEvent = 'touchmove';
eventNames.endEvent = 'touchend';
}
else {
} else {
eventNames.moveEvent = 'mousemove';
eventNames.endEvent = 'mouseup';
}
......@@ -1359,7 +1355,7 @@
};
}]);
// IDE assist
// IDE assist
/**
* @name ngScope
......
......@@ -368,8 +368,7 @@
this.customTrFn = function(value) {
return this.options.stepsArray[value];
};
}
else if (this.options.translate)
} else if (this.options.translate)
this.customTrFn = this.options.translate;
else
this.customTrFn = function(value) {
......@@ -505,8 +504,7 @@
setDisabledState: function() {
if (this.options.disabled) {
this.sliderElem.attr('disabled', 'disabled');
}
else {
} else {
this.sliderElem.attr('disabled', null);
}
},
......@@ -802,13 +800,13 @@
* @returns {undefined}
*/
shFloorCeil: function() {
var flHidden = false, clHidden = false;
var flHidden = false,
clHidden = false;
if (this.minLab.rzsl <= this.flrLab.rzsl + this.flrLab.rzsw + 5) {
flHidden = true;
this.hideEl(this.flrLab);
}
else {
} else {
flHidden = false;
this.showEl(this.flrLab);
}
......@@ -816,8 +814,7 @@
if (this.minLab.rzsl + this.minLab.rzsw >= this.ceilLab.rzsl - this.handleHalfWidth - 10) {
clHidden = true;
this.hideEl(this.ceilLab);
}
else {
} else {
clHidden = false;
this.showEl(this.ceilLab);
}
......@@ -825,16 +822,14 @@
if (this.range) {
if (this.maxLab.rzsl + this.maxLab.rzsw >= this.ceilLab.rzsl - 10) {
this.hideEl(this.ceilLab);
}
else if (!clHidden) {
} else if (!clHidden) {
this.showEl(this.ceilLab);
}
// Hide or show floor label
if (this.maxLab.rzsl <= this.flrLab.rzsl + this.flrLab.rzsw + this.handleHalfWidth) {
this.hideEl(this.flrLab);
}
else if (!flHidden) {
} else if (!flHidden) {
this.showEl(this.flrLab);
}
}
......@@ -867,8 +862,7 @@
this.hideEl(this.minLab);
this.hideEl(this.maxLab);
this.showEl(this.cmbLab);
}
else {
} else {
this.showEl(this.maxLab);
this.showEl(this.minLab);
this.hideEl(this.cmbLab);
......@@ -906,7 +900,9 @@
* @returns {jqLite} The jqLite wrapped DOM element
*/
hideEl: function(element) {
return element.css({opacity: 0});
return element.css({
opacity: 0
});
},
/**
......@@ -920,7 +916,9 @@
return element;
}
return element.css({opacity: 1});
return element.css({
opacity: 1
});
},
/**
......@@ -932,7 +930,9 @@
*/
setLeft: function(elem, left) {
elem.rzsl = left;
elem.css({left: left + 'px'});
elem.css({
left: left + 'px'
});
return left;
},
......@@ -957,7 +957,9 @@
*/
setWidth: function(elem, width) {
elem.rzsw = width;
elem.css({width: width + 'px'});
elem.css({
width: width + 'px'
});
return width;
},
......@@ -1007,8 +1009,7 @@
}
return event.originalEvent === undefined ?
event.touches[0].clientX
: event.originalEvent.touches[0].clientX;
event.touches[0].clientX : event.originalEvent.touches[0].clientX;
},
/**
......@@ -1038,8 +1039,7 @@
barTracking = 'rzSliderDrag';
barStart = this.onDragStart;
barMove = this.onDragMove;
}
else {
} else {
barTracking = 'rzSliderModel';
barStart = this.onStart;
barMove = this.onMove;
......@@ -1106,8 +1106,7 @@
if (pointer) {
this.tracking = ref;
}
else {
} else {
pointer = this.getNearestHandle(event);
this.tracking = pointer === this.minH ? 'rzSliderModel' : 'rzSliderHigh';
}
......@@ -1141,14 +1140,12 @@
return;
newValue = this.minValue;
newOffset = 0;
}
else if (newOffset >= this.maxLeft) {
} else if (newOffset >= this.maxLeft) {
if (pointer.rzsl === this.maxLeft)
return;
newValue = this.maxValue;
newOffset = this.maxLeft;
}
else {
} else {
newValue = this.offsetToValue(newOffset);
newValue = this.roundStep(newValue);
newOffset = this.valueToOffset(newValue);
......@@ -1204,8 +1201,7 @@
newMinOffset = 0;
newMaxValue = this.minValue + this.dragging.difference;
newMaxOffset = this.valueToOffset(newMaxValue);
}
else if (newOffset >= this.maxLeft - this.dragging.highDist) {
} else if (newOffset >= this.maxLeft - this.dragging.highDist) {
if (pointer.rzsl === this.dragging.highDist) {
return;
}
......@@ -1213,8 +1209,7 @@
newMaxOffset = this.maxLeft;
newMinValue = this.maxValue - this.dragging.difference;
newMinOffset = this.valueToOffset(newMinValue);
}
else {
} else {
newMinValue = this.offsetToValue(newOffset - this.dragging.lowDist);
newMinValue = this.roundStep(newMinValue);
newMinOffset = this.valueToOffset(newMinValue);
......@@ -1260,8 +1255,7 @@
/* We need to apply here because we are not sure that we will enter the next block */
this.scope.$apply();
this.callOnChange();
}
else if (this.tracking === 'rzSliderHigh' && newValue <= this.scope.rzSliderModel) {
} else if (this.tracking === 'rzSliderHigh' && newValue <= this.scope.rzSliderModel) {
this.scope[this.tracking] = this.scope.rzSliderModel;
this.updateHandles(this.tracking, this.minH.rzsl);
this.tracking = 'rzSliderModel';
......@@ -1311,13 +1305,15 @@
* @return {{moveEvent: string, endEvent: string}}
*/
getEventNames: function(event) {
var eventNames = {moveEvent: '', endEvent: ''};
var eventNames = {
moveEvent: '',
endEvent: ''
};
if (event.touches || (event.originalEvent !== undefined && event.originalEvent.touches)) {
eventNames.moveEvent = 'touchmove';
eventNames.endEvent = 'touchend';
}
else {
} else {
eventNames.moveEvent = 'mousemove';
eventNames.endEvent = 'mouseup';
}
......@@ -1359,7 +1355,7 @@
};
});
// IDE assist
// IDE assist
/**
* @name ngScope
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment