From 296ae7021e75f555da9066232faa8da3a1225f4b Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sat, 14 Jun 2014 12:18:40 +0000 Subject: no more use of jquery ui for admin menu accordion git-svn-id: http://piwigo.org/svn/trunk@28702 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/admin.tpl | 119 +++++++++++++++++++------------- 1 file changed, 70 insertions(+), 49 deletions(-) (limited to 'admin/themes/default/template/admin.tpl') diff --git a/admin/themes/default/template/admin.tpl b/admin/themes/default/template/admin.tpl index 7fc9dc179..67e0832bb 100644 --- a/admin/themes/default/template/admin.tpl +++ b/admin/themes/default/template/admin.tpl @@ -1,56 +1,74 @@ -{combine_script id='jquery.ui.accordion' load='header'}{*we load in the header because the accordion is on every admin page and usually all admin pages use the same header combined script but not the same footer script*} -{footer_script require='jquery.ui.accordion'} -jQuery(document).ready(function(){ldelim} - jQuery('#menubar').accordion({ldelim} - header: "dt.rdion", - event: "click", - heightStyle: "content", - active: {$ACTIVE_MENU} - }); +{footer_script} +jQuery.fn.lightAccordion = function(options) { + var settings = $.extend({ + header: 'dt', + content: 'dd', + active: 0 + }, options); + + return this.each(function() { + var self = jQuery(this); + + var contents = self.find(settings.content), + headers = self.find(settings.header); + + contents.not(contents[settings.active]).hide(); + + self.on('click', settings.header, function() { + var content = jQuery(this).next(settings.content); + content.slideDown(); + contents.not(content).slideUp(); + }); + }); +}; + +$('#menubar').lightAccordion({ + active: {$ACTIVE_MENU} }); {/footer_script}