/* ***********************************************************************************************

    Unify Project

    Homepage: unify-project.org
    License: MIT + Apache (V2)
    Copyright: 2012, Sebastian Fastner, Mainz, Germany, http://unify-training.com

*********************************************************************************************** */

/**
 * @break {unify.ui.layout.queue.Manager}
 */

(function() {
  
  var widgetQueue = [];

  core.Module("unify.ui.layout.queue.Visibility", {
    name : "visibility",
    
    add : function(widget) {
      widgetQueue.push(widget);
      unify.ui.layout.queue.Manager.run(unify.ui.layout.queue.Visibility.name);
    },
    
    flush : function() {
      console.log("VISIBILITY: ", widgetQueue.length, widgetQueue);
      
      for (var i=0,ii=widgetQueue.length; i<ii; i++) {
        var widget = widgetQueue[i];
        widget.checkAppearanceNeeds();
      }
    }
  });

})();
@@ -721,69 +721,175 @@
     
-console.log(%22VISIBILITY: %22, widgetQueue.length, widgetQueue);
+for (var i=0,ii=widgetQueue.length; i%3Cii; i++) %7B%0A        var children = widgetQueue%5Bi%5D.getLayoutChildren();%0A        widgetQueue = widgetQueue.concat(children);%0A      %7D
 %0A   
@@ -895,36 +895,32 @@
     %0A      for (
-var 
 i=0,ii=widgetQue
@@ -954,21 +954,8 @@
     
- var widget =
  wid
@@ -965,32 +965,16 @@
 Queue%5Bi%5D
-;%0A        widget
 .checkAp

Add children handling to visibility queue