zoneminder/web/skins/classic/views/js/state.js

46 lines
895 B
JavaScript

function checkState( element )
{
var form = element.form;
var minIndex = running?2:1;
if ( form.runState.selectedIndex < running )
{
form.saveBtn.disabled = true;
form.deleteBtn.disabled = true;
}
else
{
form.saveBtn.disabled = false;
form.deleteBtn.disabled = false;
}
if ( newState.value != '' )
{
form.saveBtn.disabled = false;
}
}
function saveState( element )
{
var form = element.form;
form.view.value = currentView;
form.action.value = 'save';
form.submit();
}
function deleteState( element )
{
var form = element.form;
form.view.value = currentView;
form.action.value = 'delete';
form.submit();
}
if ( applying )
{
function submitForm()
{
$('contentForm').submit();
}
window.addEvent( 'domready', function() { submitForm.delay( 1000 ); } );
}