Changeset 24837


Ignore:
Timestamp:
Oct 10, 2013, 10:29:39 PM (7 years ago)
Author:
rvelices
Message:

improved who can see this photo display

Location:
trunk/themes/default
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/fix-ie5-ie6.css

    r16412 r24837  
    7070.imageInfo dt  {display:block; text-align:left; font-weight:bold; padding-right:0.5em;}
    7171.imageInfo dd {display:block; text-align:left; font-weight:normal;}
    72 .relSwitchBox {position:static;}
    7372#imageInfos dd { margin: 0 0 5px 20px;}
  • trunk/themes/default/fix-ie7.css

    r16986 r24837  
    2727.imageInfo dt  {display:block; text-align:left; font-weight:bold; padding-right:0.5em;}
    2828.imageInfo dd {display:block; text-align:left; font-weight:normal;}
    29 .relSwitchBox {position:static;}
    3029#imageInfos dd { margin: 0 0 5px 20px;}
  • trunk/themes/default/template/picture.tpl

    r24802 r24837  
    272272
    273273{if $display_info.privacy_level and isset($available_permission_levels)}
    274         <div id="Privacy" class="imageInfo"><div class="relSwitchBox">
    275                 <dt><a id="privacyLevelLink" href="javascript:togglePrivacyLevelBox()">{'Who can see this photo?'|@translate}</a></dt>
    276                 <dd>
     274        <div id="Privacy" class="imageInfo">
     275                <dt>{'Who can see this photo?'|@translate}</dt>
     276                <dd>
     277                        <div>
     278                                <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a>
     279                        </div>
    277280{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    278 {footer_script require='jquery'}
    279 {literal}function setPrivacyLevel(rootUrl, id, level)
    280 {
    281 var y = new PwgWS(rootUrl);
    282 y.callService(
    283         "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
     281{footer_script require='jquery'}{strip}
     282function setPrivacyLevel(id, level){
     283(new PwgWS('{$ROOT_URL}')).callService(
     284        "pwg.images.setPrivacyLevel", { image_id:id, level:level},
    284285        {
    285286                method: "POST",
     
    287288                onSuccess: function(result) {
    288289                          jQuery('#privacyLevelBox .switchCheck').css('visibility','hidden');
    289                           jQuery('#levelCheck'+level).css('visibility','visible');
     290                                jQuery('#switchLevel'+level).prev('.switchCheck').css('visibility','visible');
     291                                jQuery('#privacyLevelLink').text(jQuery('#switchLevel'+level).text());
    290292                }
    291293        }
    292294        );
    293295}
    294 function togglePrivacyLevelBox()
    295 {
    296         var elt = document.getElementById("privacyLevelBox"),
    297                 ePos = document.getElementById("privacyLevelLink");
    298         if (elt.style.display == "none")
    299         {
    300                 elt.style.left = (ePos.offsetLeft)+"px";
    301                 elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
    302                 elt.style.display="block";
    303         }
    304         else
    305                 elt.style.display="none";
    306 }
    307 {/literal}
    308 {/footer_script}
    309 
    310                         <div id="privacyLevelBox" class="switchBox" onclick="togglePrivacyLevelBox()" style="display:none" onmouseout="e=event.toElement||event.relatedTarget;e.parentNode==this||e==this||togglePrivacyLevelBox()">
     296(SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox");
     297{/strip}{/footer_script}
     298                        <div id="privacyLevelBox" class="switchBox" style="display:none">
    311299                                {foreach from=$available_permission_levels item=label key=level}
    312                                         <span id="levelCheck{$level}" class="switchCheck" {if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
    313                                         <a id="switchLevel{$level}" href="javascript:setPrivacyLevel('{$ROOT_URL}', {$current.id}, {$level})">{$label}</a><br>
     300                                        <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
     301                                        <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br>
    314302                                {/foreach}
    315303                        </div>
    316 
    317                 </dd>
    318         </div></div>
     304                </dd>
     305        </div>
    319306{/if}
    320307{/strip}
  • trunk/themes/default/theme.css

    r24611 r24837  
    377377  padding-bottom:5px;
    378378  margin-bottom:5px;
    379 }
    380 
    381 .relSwitchBox {
    382         position: relative;
    383379}
    384380
Note: See TracChangeset for help on using the changeset viewer.