To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Show
Ignore:
Timestamp:
09/07/10 17:08:36 (21 months ago)
Author:
tboutell
Message:

Fixed #428 (you can no longer reorder in an area while it has an unsaved new slot) and greatly sped up the move arrows. They now work on the client side without waiting for the site to refresh the area.

Refactored the JavaScript? associated with the up and down arrows.

Fixed a previously unnoticed bug: a-new-slot wasn't getting cleared when a slot was saved.

TODO: strip down the response from the server to a yea or a nay.
TODO: actually do something about a nay (like refreshing the area).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/trunk/modules/a/templates/_area.php

    r2090 r2144  
    8686        <!-- START SLOT --> 
    8787        <div class="a-slot <?php echo $slot->getEffectiveVariant($slotOptions) ?> <?php echo $slot->type ?><?php echo ($slot->isNew())? ' a-new-slot':'' ?> clearfix" id="a-slot-<?php echo "$pageid-$name-$permid" ?>"> 
     88          <?php // Make the slot aware of its permid for simpler JS later ?> 
     89          <?php a_js_call('$(?).data(?, ?)', "#a-slot-$pageid-$name-$permid", 'a-permid', $permid) ?> 
    8890                <?php // Slot Controls ?> 
    8991    <?php if ($editable): ?> 
    9092                <ul class="a-ui a-controls a-slot-controls clearfix">            
    9193      <?php if ($infinite): ?> 
    92           <?php if ($i > 0): ?> 
    93                                                 <li> 
    94             <?php echo jq_link_to_remote('<span class="icon"></span>'.__('Move', null, 'apostrophe'), array( 
    95                 "url" => "a/moveSlot?" .http_build_query(array( 
    96                                                                         "id" => $page->id, 
    97                                                                         "name" => $name, 
    98                                                                         "up" => 1, 
    99                                                                         "permid" => $permid)), 
    100                                                                         "update" => "a-slots-$pageid-$name", 
    101                                                                         'complete' => 'aUI()'),  
    102                                                                         array( 
    103                                                                                 'class' => 'a-btn icon a-arrow-up no-label',  
    104                                                                                 'title' => __('Move Up', null, 'apostrophe'),  
    105                                                 )) ?> 
    106                                                 </li> 
    107           <?php endif ?> 
    108           <?php if (($i + 1) < count($slots)): ?> 
    109                                                 <li> 
    110             <?php echo jq_link_to_remote('<span class="icon"></span>'.__('Move', null, 'apostrophe'), array( 
    111                 "url" => "a/moveSlot?" .http_build_query(array( 
    112                                                                         "id" => $page->id, 
    113                                                                         "name" => $name, 
    114                                                                         "permid" => $permid)), 
    115                                                                         "update" => "a-slots-$pageid-$name", 
    116                                                                         'complete' => 'aUI()'),  
    117                                                                         array( 
    118                                                                                 'class' => 'a-btn icon a-arrow-down no-label',  
    119                                                                                 'title' => __('Move Down', null, 'apostrophe'),  
    120                                                 )) ?> 
    121             </li> 
    122         <?php endif ?> 
     94                                <li class="a-move"> 
     95                                  <a href="#" class="a-btn icon a-arrow-up no-label" title="<?php echo a_('Move Up') ?>"><span class="icon"></span><?php echo a_('Move Up') ?></a> 
     96                                </li> 
     97                                <li class="a-move"> 
     98                                  <a href="#" class="a-btn icon a-arrow-down no-label" title="<?php echo a_('Move Down') ?>"><span class="icon"></span><?php echo a_('Move Down') ?></a> 
     99                                </li> 
    123100      <?php endif ?> 
    124101 
     
    201178        }); 
    202179</script> 
     180<?php a_js_call('apostrophe.areaUpdateMoveButtons(?, ?, ?)', url_for('a/moveSlot'), $pageid, $name) ?> 
    203181<?php endif ?>