initialization issue in add_album.inc.tpl if there is no albums
git-svn-id: http://piwigo.org/svn/trunk@25280 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
7d45f2c76c
commit
8ec9e2bbb6
1 changed files with 7 additions and 5 deletions
|
|
@ -1,5 +1,7 @@
|
|||
{footer_script}{literal}
|
||||
jQuery(document).ready(function(){
|
||||
var $albumSelect = jQuery("#albumSelect");
|
||||
|
||||
jQuery(".addAlbumOpen").colorbox({
|
||||
inline: true,
|
||||
href: "#addAlbumForm",
|
||||
|
|
@ -7,8 +9,8 @@ jQuery(document).ready(function(){
|
|||
jQuery("input[name=category_name]").focus();
|
||||
|
||||
jQuery("#category_parent").html('<option value="0">------------</option>')
|
||||
.append(jQuery("#albumSelect").html())
|
||||
.val(jQuery("#albumSelect").val());
|
||||
.append($albumSelect.html())
|
||||
.val($albumSelect.val() || 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -47,13 +49,13 @@ jQuery(document).ready(function(){
|
|||
.attr("selected", "selected")
|
||||
.text(newAlbum_name);
|
||||
|
||||
jQuery("#albumSelect").find("option").removeAttr('selected');
|
||||
$albumSelect.find("option").removeAttr('selected');
|
||||
|
||||
if (parent_id==0) {
|
||||
jQuery("#albumSelect").prepend(new_option);
|
||||
$albumSelect.prepend(new_option);
|
||||
}
|
||||
else {
|
||||
jQuery("#albumSelect").find("option[value="+ parent_id +"]").after(new_option);
|
||||
$albumSelect.find("option[value="+ parent_id +"]").after(new_option);
|
||||
}
|
||||
|
||||
jQuery("#addAlbumForm form input[name=category_name]").val('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue