1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00
hotspot_ynh/sources/public/js/custom.js

30 lines
780 B
JavaScript
Raw Normal View History

$(document).ready(function() {
$('.btn-group').button();
$('[data-toggle="tooltip"]').tooltip();
$('.fileinput').click(function() {
var realinputid = '#' + $(this).attr('id').replace(/_chooser.*/, '');
$(realinputid).click();
});
$('input[type="file"]').change(function() {
var choosertxtid = '#' + $(this).attr('id') + '_choosertxt';
$(choosertxtid).val($(this).val());
});
$('.dropdown-menu li').click(function() {
var menu = $(this).parent();
var items = menu.children();
var button = menu.prev();
var input = button.prev();
items.removeClass('active');
$(this).addClass('active');
button.text($(this).text());
button.append(' <span class="caret"></span>');
input.attr('value', $(this).text());
});
});