Format old javascript with prettier

This commit is contained in:
Paul Chavard 2018-10-02 16:59:30 +02:00
parent af63ad5802
commit 7898a33469
13 changed files with 133 additions and 83 deletions

View file

@ -17,23 +17,28 @@
//= require bootstrap-wysihtml5
//= require bootstrap-wysihtml5/locales/fr-FR
/* globals $ */
$(document).on('turbolinks:load', application_init);
function application_init(){
function application_init() {
tooltip_init();
scroll_to();
}
function tooltip_init() {
$('.action_button[data-toggle="tooltip"]').tooltip({delay: { "show": 100, "hide": 100 }});
$('[data-toggle="tooltip"]').tooltip({delay: { "show": 800, "hide": 100 }});
$('.action_button[data-toggle="tooltip"]').tooltip({
delay: { show: 100, hide: 100 }
});
$('[data-toggle="tooltip"]').tooltip({ delay: { show: 800, hide: 100 } });
}
function scroll_to() {
$('.js-scrollTo').on('click', function () { // Au clic sur un élément
$('.js-scrollTo').on('click', function() {
// Au clic sur un élément
var page = $(this).attr('cible'); // Page cible
var speed = 600; // Durée de l'animation (en ms)
$('html, body').animate({scrollTop: $(page).offset().top - 200}, speed); // Go
$('html, body').animate({ scrollTop: $(page).offset().top - 200 }, speed); // Go
return false;
});
}