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
2014-11-09 23:49:06 +01:00

31 lines
815 B
JavaScript

$(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());
});
$('.switch').bootstrapToggle();
});