From 73abb2a12b87cd4aeac3af0266c3ab68d1cbb96a Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 8 Nov 2012 06:48:50 +0000 Subject: js code simplification git-svn-id: http://piwigo.org/svn/trunk@18974 68402e56-0260-453c-a942-63ccdbb3a9ee --- .../themes/default/template/batch_manager_unit.tpl | 38 ++++++++-------------- 1 file changed, 14 insertions(+), 24 deletions(-) (limited to 'admin') diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl index fde9c2aa4..7dee4fa51 100644 --- a/admin/themes/default/template/batch_manager_unit.tpl +++ b/admin/themes/default/template/batch_manager_unit.tpl @@ -4,19 +4,9 @@ {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} {footer_script require='jquery.tokeninput'} -var tag_boxes_selector = ""; -{foreach from=$elements item=element name=element} -{if $smarty.foreach.element.first} -var prefix = ""; -{else} -prefix = ", "; -{/if} - tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.id}; -{/foreach} - jQuery(document).ready(function() {ldelim} - jQuery(tag_boxes_selector).tokenInput( - [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], + jQuery('select[name|="tags"]').tokenInput( + [{foreach from=$tags item=tag name=tags}{ldelim}name:"{$tag.name|@escape:'javascript'}",id:"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], {ldelim} hintText: '{'Type in a search term'|@translate}', noResultsText: '{'No results'|@translate}', @@ -112,7 +102,7 @@ jQuery(document).ready(function() {ldelim} {'Tags'|@translate} - {foreach from=$element.TAGS item=tag} {/foreach} @@ -131,24 +121,24 @@ jQuery(document).ready(function() {ldelim} {/foreach} -{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} +{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}

- - + +

{/if} - +{/footer_script} -- cgit v1.2.3