Changeset 499

Show
Ignore:
Timestamp:
08/28/06 05:42:03
Author:
piv
Message:

fixed bug with reordering, don't collapse after reordering ...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneTabs/trunk/TODO.txt

    r498 r499  
    22  * Opera compatibility 
    33  * 'portal-globalnav' visualization without page reloading 
    4   * sliding 'Advanced' section 
    5   * intelligent url processing 
     4#  * sliding 'Advanced' section 
     5#  * intelligent url processing on adding 
  • qPloneTabs/trunk/skins/qPloneTabs/javascripts/qplonetabs.js

    r498 r499  
    2020         parameters: params, 
    2121         onSuccess: function(request){ 
    22            $A($('tabslist').getElementsByTagName('INPUT')).findAll(function(h){return h.type=='hidden';}).each(function(f,idx){f.value=idx;}); 
     22           var lis = $A($('tabslist').getElementsByTagName('LI')), 
     23               inputs = function(li){return $A(li.getElementsByTagName('INPUT'))}; 
     24           lis.each(function(el,idx){ 
     25             inputs(el).each(function(inpt){ 
     26               inpt.type=='hidden'?inpt.value=idx:inpt.name=inpt.name.replace(/i\d+_/, 'i'+idx+'_'); 
     27             }); 
     28           }); 
    2329           shiftClassNames('app', 'sorting', 'viewing'); 
    2430           Sortable.destroy('tabslist'); 
     
    95101    } 
    96102  }, 
    97   '#app .collapsibleContent1' : function(el){collapseAdvanced(el.parentNode);}, 
    98103  '#app .collapsibleHeader1' : function(el){ 
    99104    el.onclick =  function(ev){ 
     
    247252          new Ajax.Updater({success:'roottabs'}, 'qpt_getroottabs', { 
    248253            method : 'get', 
    249             onSuccess : function(){Behaviour.apply()} 
     254            onComplete : function(){Behaviour.apply()} 
    250255          }); 
    251256       } 
     
    264269Ajax.Responders.register(globalHandlers); 
    265270 
     271Event.observe(window, 'load', collapseAdvanced); 
     272Event.observe(window, 'unload', function(){gBeforeReorderFragment = null; gBeforeEditData = null;}); 
     273 
     274function collapseAdvanced() { 
     275  $A(document.getElementsByClassName('collapsible1', 'app')).each( 
     276    function(dl){ 
     277      var dd = dl.getElementsByTagName('DD')[0]; 
     278      if (!Element.hasClassName(dl, 'collapsedBlock') && Element.visible(dd)) { 
     279        shiftClassNames(dl, 'expandedBlock', 'collapsedBlock'); 
     280      }; 
     281      Element.hide(dd); 
     282    } 
     283  ); 
     284}; 
     285 
    266286function shiftClassNames(el, from, to) { 
    267287  Element.removeClassName(el, from); 
    268288  Element.addClassName(el, to); 
    269 }; 
    270  
    271 function collapseAdvanced(dl) { 
    272   var dd = dl.getElementsByTagName('DD')[0]; 
    273   if (!Element.hasClassName(dl, 'collapsedBlock') && Element.visible(dd)) { 
    274     shiftClassNames(dl, 'expandedBlock', 'collapsedBlock'); 
    275   } 
    276   Element.hide(dd); 
    277289}; 
    278290 
  • qPloneTabs/trunk/skins/qPloneTabs/qplonetabs.css.dtml

    r498 r499  
    33 
    44/* 
    5    There are two global self-excludes classes: 'viewing' and 'sorting', 
    6    one local class 'editing' for menu items which are expanded for editing, 
    7    and one more local class 'adding' for adding form when it's in open state. 
    8  
    9    Reorder action are always available, so it TEMPORARY stop other actions on the form: 
    10        editing items 
    11        deleting items 
    12        toggling item visibility 
    13        adding item 
    14  
    15    After returning to 'viewing' class after 'sorting' all items become to the same state they 
    16    be before sorting (in editing state or not). 
    17  
    18    And the same behaviour for adding form: form state ('adding' or not) become the same it was 
    19    before sorting. 
    20  
    21    All actions except reordering and deleting* could be done at any 
    22    in relationship to each other. 
    23  
    24    * deleting can't be done during the editing the same item 
     5*************************************************************************************************** 
     6*                                                                                                 * 
     7*   There are two global self-excludes classes: 'viewing' and 'sorting',                          * 
     8*   one local class 'editing' for menu items which are expanded for editing,                      * 
     9*   and one more local class 'adding' for adding form when it's in open state.                    * 
     10*                                                                                                 * 
     11*   Reorder action are always available and it TEMPORARY stop other actions on the form:          * 
     12*       editing items                                                                             * 
     13*       deleting items                                                                            * 
     14*       toggling item visibility                                                                  * 
     15*       adding item                                                                               * 
     16*                                                                                                 * 
     17*   After returning to 'viewing' class from 'sorting' all items become to the same state they     * 
     18*   were before sorting (in editing state or not).                                                * 
     19*                                                                                                 * 
     20*   And the same behaviour for adding form: form state ('adding' or not) become the same it was   * 
     21*   before sorting.                                                                               * 
     22*                                                                                                 * 
     23*   All actions except reordering could be done at any time in relationship to each other.        * 
     24*                                                                                                 * 
     25*************************************************************************************************** 
    2526*/ 
    2627 
    2728#app.viewing                      .reorder-controls, 
    2829#app.sorting                      .sort-controls, 
    29 /* #app.sorting li.editing span, */ 
    3030#app.viewing li.editing           .editform, 
    3131#app #addaction.adding            .field-visible,