<commit_before>// a bit different from a normal cell, it holds the main view ui elements but also the main conatiner

var TopCell = function(layout, setDimensions, onresize)
{
  var self = this;
  this.setStartDimesions = setDimensions;
  this.onresize = onresize;

  this.appendUiNodes = function()
  {
    this.container = new TopContainer(this); // actually just a cell
    this.tab = new TopTabs(this);
    this.toolbar = new TopToolbar(this);
    this.statusbar = new TopStatusbar(this);
  }

  this.update = function()
  {
    if( !this.children.length )
    {
      if( !this.tab.activeTab )
      {
        if(this.tab.tabs.length)
        {
          this.tab.setActiveTab( this.tab.tabs[0].ref_id );
        }
      }
      else
      {
        this.toolbar.setDimensions();
        this.tab.setDimensions();
        this.statusbar.setDimensions();
        this.container.setDimensions();
      }
    }
    else
    {

    }

  }

  this.showView = function(view_id)
  {
    if( views[view_id].isvisible() )
    {
      views[view_id].update();
    }
    else
    {
      var ret = this.getView(view_id), tab = null, i = 0;
      if( ret )
      {
        for( ; tab = ret[i]; i += 2 )
        {
          if( tab.activeTab != ret[i+1] )
          {
            tab.setActiveTab(ret[i+1]);
          }
        }
      }
    }
  }

  this.setup = function()
  {
    var view_id = this.tab && this.tab.activeTab;

    if( view_id )
    {
      this.container.setup(view_id);
    }
  }

  document.addEventListener('resize', function(event){self.onresize()}, false);
<commit_msg>try to fix  Bug 323461<commit_after>// a bit different from a normal cell, it holds the main view ui elements but also the main conatiner

var TopCell = function(layout, setDimensions, onresize)
{
  var self = this;
  this.setStartDimesions = setDimensions;
  var resize_timeout = new Timeouts();
  this.onresize = onresize;
  
  var delayed_resize = function()
  {
    self.onresize();
  }
  
  var setDelayedResize = function()
  {
    resize_timeout.set(delayed_resize, 32);
  }

  this.appendUiNodes = function()
  {
    this.container = new TopContainer(this); // actually just a cell
    this.tab = new TopTabs(this);
    this.toolbar = new TopToolbar(this);
    this.statusbar = new TopStatusbar(this);
  }

  this.update = function()
  {
    if( !this.children.length )
    {
      if( !this.tab.activeTab )
      {
        if(this.tab.tabs.length)
        {
          this.tab.setActiveTab( this.tab.tabs[0].ref_id );
        }
      }
      else
      {
        this.toolbar.setDimensions();
        this.tab.setDimensions();
        this.statusbar.setDimensions();
        this.container.setDimensions();
      }
    }
    else
    {

    }

  }

  this.showView = function(view_id)
  {
    if( views[view_id].isvisible() )
    {
      views[view_id].update();
    }
    else
    {
      var ret = this.getView(view_id), tab = null, i = 0;
      if( ret )
      {
        for( ; tab = ret[i]; i += 2 )
        {
          if( tab.activeTab != ret[i+1] )
          {
            tab.setActiveTab(ret[i+1]);
          }
        }
      }
    }
  }

  this.setup = function()
  {
    var view_id = this.tab && this.tab.activeTab;

    if( view_id )
    {
      this.container.setup(view_id);
    }
  }

  document.addEventListener('resize', setDelayedResize, false);

{'fraction_non_alphanumeric': 0.12972329663790538, 'fraction_numerical': 0.005355548943766736, 'mean_word_length': 1.9991079393398752, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2819264', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1131, 'n_words': 219}