32 lines
632 B
JavaScript
32 lines
632 B
JavaScript
|
$(document).ready(function(){
|
||
|
|
||
|
/* News */
|
||
|
let news = $('#news marquee.news-items')
|
||
|
news.find('.news-item').hover(
|
||
|
() => news[0].stop(),
|
||
|
() => news[0].start()
|
||
|
)
|
||
|
|
||
|
/* Tooltip */
|
||
|
if($('[data-bs-toggle="tooltip"]').length){
|
||
|
$('[data-bs-toggle="tooltip"]').tooltip()
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Clearable text inputs
|
||
|
*/
|
||
|
$('*[data-id="clearable"]').each(function() {
|
||
|
const $inp = $(this).find("input:text"),
|
||
|
$cle = $(this).find(".clearable__clear");
|
||
|
|
||
|
$inp.on("input", function(){
|
||
|
$cle.toggle(!!this.value);
|
||
|
});
|
||
|
|
||
|
$cle.on("touchstart click", function(e) {
|
||
|
e.preventDefault();
|
||
|
$inp.val("").trigger("input");
|
||
|
});
|
||
|
});
|
||
|
|
||
|
})
|