Ignore:
Timestamp:
Jan 10, 2014, 7:37:58 PM (10 years ago)
Author:
mistic100
Message:

add "Home" (admin) link, hide <select> until they are populated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdminTools/template/public_controller.js

    r26061 r26603  
    3232  // fill multiview selects
    3333  // data came from AJAX request or sessionStorage
    34   function populateMultiView($target) {
    35     if ($target.data('init')) return;
     34  function populateMultiView() {
     35    var $multiview = $ato.find('.multiview');
     36
     37    if ($multiview.data('init')) return;
    3638
    3739    var render = function(data) {
     
    4042        html+= '<option value="'+ user.id +'">'+ user.username +'</option>';
    4143      });
    42       $target.find('select[data-type="view_as"]').html(html)
     44      $multiview.find('select[data-type="view_as"]').html(html)
    4345        .val(__this.multiView.view_as);
    4446
     
    4749        html+= '<option value="'+ theme +'">'+ theme +'</option>';
    4850      });
    49       $target.find('select[data-type="theme"]').html(html)
     51      $multiview.find('select[data-type="theme"]').html(html)
    5052        .val(__this.multiView.theme);
    5153
     
    5456        html+= '<option value="'+ language.id +'">'+ language.name +'</option>';
    5557      });
    56       $target.find('select[data-type="lang"]').html(html)
     58      $multiview.find('select[data-type="lang"]').html(html)
    5759        .val(__this.multiView.lang);
    5860
    59       $target.data('init', true);
     61      $multiview.data('init', true);
     62
     63      $multiview.find('.switcher').show();
    6064    };
    6165
     
    130134      'click': function() {
    131135        if ($(this).hasClass('multiview')) {
    132           populateMultiView($(this).find('ul'));
     136          populateMultiView();
    133137        }
    134138        $(this).find('ul').toggle();
Note: See TracChangeset for help on using the changeset viewer.