Commit deedd4a3 by François

Run eslint --fix

parent ad099012
Pipeline #1549 passed with stage
in 1 minute 29 seconds
...@@ -228,7 +228,7 @@ function display_makeups_members() { ...@@ -228,7 +228,7 @@ function display_makeups_members() {
/** /**
* Send request to update members nb of makeups to do * Send request to update members nb of makeups to do
* *
* @param {Array} member_ids * @param {Array} member_ids
* @param {String} action increment | decrement * @param {String} action increment | decrement
*/ */
......
...@@ -100,7 +100,7 @@ function init_home() { ...@@ -100,7 +100,7 @@ function init_home() {
e.preventDefault(); e.preventDefault();
goto('faq'); goto('faq');
}); });
if (partner_data.is_in_association === false) { if (partner_data.is_in_association === false) {
$("#home .member_associated_partner_area").hide(); $("#home .member_associated_partner_area").hide();
} else { } else {
......
...@@ -50,18 +50,19 @@ function prepare_server_data(data) { ...@@ -50,18 +50,19 @@ function prepare_server_data(data) {
for (history_item of data) { for (history_item of data) {
if (history_item.is_amnesty !== undefined) { if (history_item.is_amnesty !== undefined) {
let shift_datetime = new Date(history_item.date_begin); let shift_datetime = new Date(history_item.date_begin);
let str_shift_datetime = `${("0" + shift_datetime.getDate()).slice(-2)}/${("0" + (shift_datetime.getMonth() + 1)).slice(-2)}/${shift_datetime.getFullYear()}` let str_shift_datetime = `${("0" + shift_datetime.getDate()).slice(-2)}/${("0" + (shift_datetime.getMonth() + 1)).slice(-2)}/${shift_datetime.getFullYear()}`;
history_item.shift_name = `${history_item.shift_name} du ${str_shift_datetime}` history_item.shift_name = `${history_item.shift_name} du ${str_shift_datetime}`;
} else { } else {
history_item.shift_name = (history_item.shift_id === false) ? '' : history_item.shift_id[1]; history_item.shift_name = (history_item.shift_id === false) ? '' : history_item.shift_id[1];
if (history_item.name === "Services des comités") { if (history_item.name === "Services des comités") {
let shift_datetime = new Date(history_item.date_begin); let shift_datetime = new Date(history_item.date_begin);
let str_shift_datetime = `${("0" + shift_datetime.getDate()).slice(-2)}/${("0" + (shift_datetime.getMonth() + 1)).slice(-2)}/${shift_datetime.getFullYear()}` let str_shift_datetime = `${("0" + shift_datetime.getDate()).slice(-2)}/${("0" + (shift_datetime.getMonth() + 1)).slice(-2)}/${shift_datetime.getFullYear()}`;
str_shift_datetime = str_shift_datetime + " " + shift_datetime.toLocaleTimeString("fr-fr", time_options); str_shift_datetime = str_shift_datetime + " " + shift_datetime.toLocaleTimeString("fr-fr", time_options);
history_item.shift_name = `Services des comités ${str_shift_datetime}` history_item.shift_name = `Services des comités ${str_shift_datetime}`;
} }
} }
......
...@@ -189,11 +189,11 @@ function init_my_info_data() { ...@@ -189,11 +189,11 @@ function init_my_info_data() {
}); });
}); });
} else if (partner_data.cooperative_state === 'exempted') { } else if (partner_data.cooperative_state === 'exempted') {
const d = new Date(Date.parse(partner_data.leave_stop_date)); const d = new Date(Date.parse(partner_data.leave_stop_date));
const f_date_delay_stop = d.getDate()+'/'+("0" + (d.getMonth() + 1)).slice(-2)+'/'+d.getFullYear(); const f_date_delay_stop = d.getDate()+'/'+("0" + (d.getMonth() + 1)).slice(-2)+'/'+d.getFullYear();
$(".delay_date_stop").text(f_date_delay_stop); $(".delay_date_stop").text(f_date_delay_stop);
$(".delay_date_stop_container").show(); $(".delay_date_stop_container").show();
} }
if ( if (
...@@ -252,29 +252,33 @@ $(document).ready(function() { ...@@ -252,29 +252,33 @@ $(document).ready(function() {
}; };
}); });
(function($,sr){ (function($, sr) {
// debouncing function from John Hann // debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) { var debounce = function (func, threshold, execAsap) {
var timeout; var timeout;
return function debounced () { return function debounced () {
var obj = this, args = arguments; var obj = this, args = arguments;
function delayed () { function delayed () {
if (!execAsap) if (!execAsap)
func.apply(obj, args); func.apply(obj, args);
timeout = null; timeout = null;
}; }
if (timeout) if (timeout)
clearTimeout(timeout); clearTimeout(timeout);
else if (execAsap) else if (execAsap)
func.apply(obj, args); func.apply(obj, args);
timeout = setTimeout(delayed, threshold || 100); timeout = setTimeout(delayed, threshold || 100);
}; };
} };
// smartresize // smartresize
jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
jQuery.fn[sr] = function(fn) {
})(jQuery,'smartresize'); return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr);
\ No newline at end of file };
})(jQuery, 'smartresize');
\ No newline at end of file
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