bug 1642 fixed: if no category exists, prevent from selecting an existing

category (before form submission).

git-svn-id: http://piwigo.org/svn/trunk@6057 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall 2010-05-03 21:24:34 +00:00
commit 1f01b7f912

View file

@ -49,6 +49,12 @@ jQuery(document).ready(function(){
}
if ($("select[name=category] option").length == 0) {
$('input[name=category_type][value=existing]').attr('disabled', true);
$('input[name=category_type]').attr('checked', false);
$('input[name=category_type][value=new]').attr('checked', true);
}
$("input[name=category_type]").click(function () {
$("[id^=category_type_]").hide();
$("#category_type_"+$(this).attr("value")).show();