diff options
author | mistic100 <mistic@piwigo.org> | 2013-11-01 10:28:36 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2013-11-01 10:28:36 +0000 |
commit | 8ec9e2bbb6ad5a89f7af901e71b39e67703d2d4f (patch) | |
tree | 4be2e3a862bce13784572770a35d79be56b46cc3 /admin/themes/default/template/include | |
parent | 7d45f2c76c5737e10a5deb2d4e41e6bed89afa70 (diff) |
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
Diffstat (limited to 'admin/themes/default/template/include')
-rw-r--r-- | admin/themes/default/template/include/add_album.inc.tpl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/admin/themes/default/template/include/add_album.inc.tpl b/admin/themes/default/template/include/add_album.inc.tpl index acbdc948a..ef8ae1458 100644 --- a/admin/themes/default/template/include/add_album.inc.tpl +++ b/admin/themes/default/template/include/add_album.inc.tpl @@ -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(''); |