From 8c304e6a54f636b8b21a7a4a398bfe91b9535495 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 1 Feb 2011 15:14:02 +0000 Subject: bug 2171 fixed: photo order in a given album, hide the "Manual order" options when this option is not selected. git-svn-id: http://piwigo.org/svn/trunk@9039 68402e56-0260-453c-a942-63ccdbb3a9ee --- .../themes/default/template/element_set_ranks.tpl | 40 ++++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/admin/themes/default/template/element_set_ranks.tpl b/admin/themes/default/template/element_set_ranks.tpl index b68053680..84fc33b40 100644 --- a/admin/themes/default/template/element_set_ranks.tpl +++ b/admin/themes/default/template/element_set_ranks.tpl @@ -2,17 +2,33 @@ {combine_script id='jquery.ui.sortable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.sortable.packed.js' } {footer_script require='jquery.ui.sortable'}{literal} jQuery(document).ready(function() { - jQuery('ul.thumbnails').sortable( { - revert: true, opacity: 0.7, - handle: $('.rank-of-image').add('.rank-of-image img'), - update: function() { - $(this).find('li').each(function(i) { - $(this).find("input[name^=rank_of_image]") - .each(function() { $(this).attr('value', (i+1)*10)}); - }); - $('#image_order_rank').attr('checked', true); - } - }); + function checkOrderOptions() { + jQuery("#image_order_user_define_options").hide(); + if (jQuery("input[name=image_order_choice]:checked").val() == "user_define") { + jQuery("#image_order_user_define_options").show(); + } + } + + jQuery('ul.thumbnails').sortable( { + revert: true, opacity: 0.7, + handle: $('.rank-of-image').add('.rank-of-image img'), + update: function() { + $(this).find('li').each(function(i) { + $(this).find("input[name^=rank_of_image]").each(function() { + $(this).attr('value', (i+1)*10) + }); + }); + + $('#image_order_rank').attr('checked', true); + checkOrderOptions(); + } + }); + + jQuery("input[name=image_order_choice]").click(function () { + checkOrderOptions(); + }); + + checkOrderOptions(); }); {/literal}{/footer_script} @@ -54,6 +70,7 @@ jQuery(document).ready(function() {

+

{foreach from=$image_orders item=order}

{/foreach} +

-- cgit v1.2.3