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

Changeset 2164

Show
Ignore:
Timestamp:
09/09/10 12:11:21 (17 months ago)
Author:
tboutell
Message:

John and I found and fixed the following bug:

* If you save a singleton slot that has never been saved before, and variants exist, the Options menu does not appear until you refresh the page

There is special-case code to update the Options menu when a slot gets saved, however that code did not account for the fact that singleton slot controls are hauled up one level to their area wrapper.

Location:
plugins/apostrophePlugin/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/trunk/lib/toolkit/BaseaTools.class.php

    r2134 r2164  
    574574    // 2. If app_a_allowed_variants is set and a specific list of allowed variants 
    575575    // is provided for this slot type, those variants are allowed. 
    576     // 3. If app_a_allowed_variatns is set and a specific list is not present for this slot type, 
     576    // 3. If app_a_allowed_variants is set and a specific list is not present for this slot type, 
    577577    // no variants are allowed for this slot type. 
    578578    // 4. An allowed_variants option in an a_slot or a_area call overrides all of the above. 
  • plugins/apostrophePlugin/trunk/modules/a/templates/_area.php

    r2160 r2164  
    159159                        <?php if (!$infinite): ?> 
    160160                                <?php // Singleton Slot Controls ?> 
    161                                 if ($('#a-area-<?php echo "$pageid-$name" ?>.singleton .a-slot-controls-moved').length) {       <?php // This is far from optimal. We are still using jQuery to "toss up" the slot controls if it's a Singleton slot. ?> 
    162                                         $('#a-area-<?php echo "$pageid-$name" ?>.singleton .a-slot-controls').remove(); <?php // If the slot controls have already been pushed up, remove any new instances from an Ajax return ?> 
    163                                 } 
    164                                 else 
    165                                 { 
     161                                $('#a-area-<?php echo "$pageid-$name" ?>.singleton .a-slot-controls-moved').remove(); 
    166162                                        $('#a-area-<?php echo "$pageid-$name" ?>.singleton .a-slot-controls').prependTo($('#a-area-<?php echo "$pageid-$name" ?>')).addClass('a-area-controls a-slot-controls-moved').removeClass('a-slot-controls');   <?php // Move up the slot controls and give them some class names. ?> 
    167                                         $('ul.a-slot-controls-moved a.a-btn.a-history-btn').removeClass('big'); // Singleton Slots can't have big history buttons, Sorry Charlie! 
    168                                 };                               
     163                                        $('ul.a-slot-controls-moved a.a-btn.a-history-btn').removeClass('big'); <?php // Singleton Slots can't have big history buttons, Sorry Charlie! ?> 
    169164                        <?php endif ?> 
    170165 
  • plugins/apostrophePlugin/trunk/modules/a/templates/_slot.php

    r2152 r2164  
    134134          <?php // It's OK to show the variants menu once we've saved something ?> 
    135135          <?php if (!$slot->isNew()): ?> 
    136             outerWrapper.find('.a-controls li.variant').show(); 
     136            var singletonArea = outerWrapper.closest('.singleton'); 
     137            if (singletonArea.length) 
     138            { 
     139              singletonArea.find('.a-controls li.variant').show(); 
     140            } 
     141            else 
     142            { 
     143              outerWrapper.find('.a-controls li.variant').show(); 
     144            } 
    137145          <?php endif ?> 
    138146        <?php endforeach ?>