From e7183e91d9c7fd84ae21a7f59926824ec6c78d9e Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 20 Dec 2015 20:38:30 +0100 Subject: use window.SwitchBox instead of duplicating code --- themes/default/template/picture.tpl | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'themes/default') diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index f18fdd615..3cccf6b29 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -74,19 +74,7 @@ function changeImgSrc(url,typeSave,typeMap) jQuery().ready(function() { jQuery("#downloadSwitchLink").removeAttr("href"); - jQuery("#downloadSwitchLink").click(function() { - var elt = jQuery("#downloadSwitchBox"); - - elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5)) - .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true)) - .toggle(); - - return false; - }); - - jQuery("#downloadSwitchBox").on("mouseleave click", function() { - jQuery(this).hide(); - }); + (window.SwitchBox=window.SwitchBox||[]).push("#downloadSwitchLink", "#downloadSwitchBox"); }); {/literal}{/footer_script} -- cgit v1.2.3