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/clear/theme.css | 16 ++--- admin/themes/default/template/admin.tpl | 119 +++++++++++++++++++------------- admin/themes/roma/theme.css | 9 +-- 3 files changed, 81 insertions(+), 63 deletions(-) (limited to 'admin') diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css index c481771b1..6021785c4 100644 --- a/admin/themes/clear/theme.css +++ b/admin/themes/clear/theme.css @@ -160,27 +160,23 @@ margin-top:4px; padding-bottom:3px; padding-top:3px; top:1px; .tabsheet a span { font-size:10px; margin-right:2px; padding:0 3px 0 1px; } .sort { clear: none; } + /* menubar is on all admin pages => No specific css file */ #menubar { padding:0; width:207px; z-index:99; text-align: left;margin-top:7px; margin-left:0; } -#menubar ul.scroll { overflow-y:auto; max-height:500px; - /* Only IE family supports colored scrollbar */ - scrollbar-face-color: #ddd; scrollbar-shadow-color: #bbb; scrollbar-highlight-color: #fff; - scrollbar-3dlight-color: #d6d6d6; scrollbar-darkshadow-color: #ccc; scrollbar-track-color: #eee; - scrollbar-arrow-color: #0cccc; } -#menubar dd { margin: 0; padding: 0;} -#menubar dl { width: 200px; border:0; margin: 0; padding: 0; display: block; min-height:35px; border:1px solid #ddd; background-color:#f1f1f1; border-left:none; border-right:1px solid #ddd;} -#menubar dl.first {border-top:none;border-radius:0 6px 0 0;} -#menubar dl.first dt {border-radius:0 6px 0 0;} -#menubar dl.last {border-bottom:1px solid #ddd; border-radius:0 0 6px 0;} +#menubar ul.scroll { overflow-y:auto; max-height:500px; } +#menubar dl { width: 200px; min-height:35px; border:0; margin: 0; padding: 0; display: block; border:1px solid #ddd; background-color:#f1f1f1; border-left:none; } +#menubar dd { margin: 0; padding: 0; } #menubar dt { background-color: #ddd; margin: 0; display: block; font-weight:bold; position:relative; padding: 5px 1px 4px 5px; font-size: 13px; color: #777; cursor:pointer; } +#menubar dl:first-of-type, #menubar dl:first-of-type dt { border-radius:0 6px 0 0; } +#menubar dl:last-of-type { border-radius:0 0 6px 0; } #menubar li { margin: 0; padding-left:10px; } #menubar li A { display:block; } #menubar li A:hover {color:black; text-decoration:none} 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}