wg-portal/assets/js/custom.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-11-05 13:37:51 -05:00
(function($) {
"use strict"; // Start of use strict
// Smooth scrolling using jQuery easing
$(document).on('click', 'a.scroll-to-top', function(e) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: ($($anchor.attr('href')).offset().top)
}, 1000, 'easeInOutExpo');
e.preventDefault();
});
2020-11-09 14:26:34 -05:00
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
2020-11-10 16:23:05 -05:00
$(".online-status").each(function(){
const onlineStatusID = "#" + $(this).attr('id');
$.get( "/user/status?pkey=" + encodeURIComponent($(this).attr('data-pkey')), function( data ) {
console.log(onlineStatusID + " " + data)
if(data === true) {
$(onlineStatusID).html('<i class="fas fa-link text-success"></i>');
} else {
$(onlineStatusID).html('<i class="fas fa-unlink"></i>');
}
});
});
$(function() {
$('select.device-selector').change(function() {
this.form.submit();
});
});
2020-11-05 13:37:51 -05:00
})(jQuery); // End of use strict