You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/frontend/js/cvm.js

47 lines
1.0 KiB
JavaScript

var command_running = false;
$(function(){
$('.clickable').click(function(){
window.location.href = $(this).data('url');
});
$('.button-loader').click(function(){
if(command_running === false)
{
$('.button-loader').addClass('disabled').click(function(event){
event.preventDefault();
event.stopPropagation();
return false;
});
$(this).children('.button-icon').addClass('running')[0].src = "/images/loading.gif";
command_running = true;
}
});
$('.enabler').change(function(){
var group = $(this).data("enable-group");
if($(this).is(':checked'))
{
$('.disabled').each(function(index, item){
if($(item).data("disabled-group") == group)
{
$(item).children('input').removeAttr('disabled');
$(item).removeClass('disabled');
}
});
}
else
{
$('form .field').each(function(index, item){
if($(item).data("disabled-group") == group)
{
$(item).children('input').attr('disabled', 'disabled');
$(item).addClass('disabled');
}
});
}
})
});