diff options
author | rvelices <rv-github@modusoptimus.com> | 2012-03-27 20:05:37 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2012-03-27 20:05:37 +0000 |
commit | 36290184dd8b78bd3f11c5b320c20b203a93b4f8 (patch) | |
tree | bc4c39da3d630aac6e397a6a81caed66b7bbc7b7 /themes/default/template/picture.tpl | |
parent | cc1d7fd3e658b48afd49d585b9a43fff5674d045 (diff) |
- remove unnecessary classes switchSelected switchUnselected (same effect acheved through visibility)
- remove unused css
git-svn-id: http://piwigo.org/svn/trunk@13773 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | themes/default/template/picture.tpl | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index ee4ec5f85..17b2c7750 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -19,7 +19,7 @@ <div class="actionButtons"> {if count($current.unique_derivatives)>1} -{footer_script}{literal} +{footer_script require='jquery'}{literal} function changeImgSrc(url,typeSave,typeMap) { var theImg = document.getElementById("theMainImage"); @@ -29,11 +29,9 @@ function changeImgSrc(url,typeSave,typeMap) theImg.src = url; theImg.useMap = "#map"+typeMap; } - jQuery('.derivativeChecked').hide(); - jQuery('#derivativeChecked'+typeSave).show(); - jQuery('#derivativeSiwtchBox .switchSelected').addClass('switchUnselected').removeClass('switchSelected'); - jQuery('#derivativeName'+typeSave).addClass('switchSelected').removeClass('switchUnselected'); - document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}'; + jQuery('#derivativeSwitchBox .switchCheck').css('visibility','hidden'); + jQuery('#derivativeChecked'+typeSave).css('visibility','visible'); + document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}'; } function toggleDerivativeSwitchBox() @@ -42,7 +40,6 @@ function toggleDerivativeSwitchBox() ePos = document.getElementById("derivativeSwitchLink"); if (elt.style.display==="none") { - elt.style.position = "absolute"; elt.style.left = (ePos.offsetLeft)+"px"; elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px"; elt.style.display=""; @@ -50,17 +47,18 @@ function toggleDerivativeSwitchBox() else elt.style.display="none"; } +jQuery("#derivativeSwitchBox").on('mouseleave click', function() { + this.style.display="none"; +} +); {/literal}{/footer_script} {strip}<a id="derivativeSwitchLink" href="javascript:toggleDerivativeSwitchBox()" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-sizes"> </span><span class="pwg-button-text">{'Photo sizes'|@translate}</span></a> -<div id="derivativeSwitchBox" class="switchBox" onclick="toggleDerivativeSwitchBox()" style="display:none" onmouseout="e=event.toElement||event.relatedTarget;e.parentNode==this||e.parentNode.parentNode==this||e==this||toggleDerivativeSwitchBox()"> +<div id="derivativeSwitchBox" class="switchBox" style="display:none"> <div class="switchBoxTitle">{'Photo sizes'|@translate}</div> {foreach from=$current.unique_derivatives item=derivative key=derivative_type} -<span class="derivativeChecked switchCheck" - id="derivativeChecked{$derivative_type}" {if $derivative->get_type() ne $current.selected_derivative->get_type()}style="display:none"{/if}>✔ </span> -<a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}')" - id="derivativeName{$derivative_type}" - class="{if $derivative->get_type() == $current.selected_derivative->get_type()}switchSelected{else}switchUnselected{/if}"> +<span class="switchCheck" id="derivativeChecked{$derivative_type}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/if}>✔ </span> +<a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}')"> {$derivative->get_type()|@translate}<span class="derivativeSizeDetails"> ({$derivative->get_size_hr()})</span> </a><br> {/foreach} |