find(".blade-content");
                    var containerBlock = currentBlade.find(".blade-container");

                    var bladeWidth = "";
                    var bladeMinWidth = "";

                    if ((scope.blade.isExpandable && scope.blade.isExpanded) || (!scope.blade.isExpandable && scope.blade.isMaximized)) {
                        // minimal required width + container padding
                        bladeMinWidth = 'calc(' + contentBlock.css("min-width") +'+'+ parseInt(containerBlock.outerWidth() - containerBlock.width()) + 'px)';
                    }

                    if (scope.blade.isExpandable && scope.blade.isExpanded) {
                        var offset = parentBlade.length > 0? parentBlade.width() : 0;
                        // free space of view - parent blade size (if exist)
                        bladeWidth = 'calc(100% -'+ offset + 'px)';
                    } else if (!scope.blade.isExpandable && scope.blade.isMaximized) {
                        currentBlade.attr('data-width', currentBlade.outerWidth());
                        bladeWidth = '100%';
                    }

                    currentBlade.width(bladeWidth);
                    currentBlade.css('min-width', bladeMinWidth);

                    setVisibleToolsLimit();
                }

                scope.$watch('blade.isExpanded', function () {
                    // we must recalculate position only at next digest cycle,
                    // because at this time blade UI is not fully (re)initialized
                    // for example, ng-class set classes after this watch called
                    $timeout(updateSize, 0, false);
                });

                scope.$on('$includeContentLoaded', function (event, src) {
                    if (src === scope.blade.template) {
                        // see above
                        $timeout(function () {
                            updateSize();
                            scrollContent();
                        }, 0, false);
                    }
                });

                scope.bladeMaximize = function () {
                    scope.blade.isMaximized = true;
                    updateSize();
                    scrollContent();
                };

                scope.bladeMinimize = function
find(".blade - content "); 
                     var containerBlock = currentBlade.find(".blade - container "); 

                     var bladeWidth = " "; 
                     var bladeMinWidth = " "; 

                     if (( scope.blade.isExpandable & & scope.blade.isExpanded) || (! scope.blade.isExpandable & & scope.blade.isMaximized) ) { 
                         // minimal required width + container padding 
                         bladeMinWidth =' calc (' + contentBlock.css("min - width ") +' +' + parseInt(containerBlock.outerWidth () - containerBlock.width ()) +' px)'; 
                     } 

                     if (scope.blade.isExpandable & & scope.blade.isExpanded) { 
                         var offset = parentBlade.length > 0? parentBlade.width (): 0; 
                         // spare quad of view - parent blade size (if exist) 
                         bladeWidth =' calc(100% -'+ offset +' post exchange)'; 
                     } else if (! scope.blade.isExpandable & & scope.blade.isMaximized) { 
                         currentBlade.attr('data - width', currentBlade.outerWidth ()); 
                         bladeWidth =' 100%'; 
                     } 

                     currentBlade.width(bladeWidth); 
                     currentBlade.css('min - width', bladeMinWidth); 

                     setVisibleToolsLimit (); 
                 } 

                 scope.$watch('blade.isExpanded', function () { 
                     // we must recalculate position only at following digest cycle, 
                     // because at this clock time blade UI is not fully (re)initialized 
                     // for exercise, ng - class set class after this lookout called 
                     $ timeout(updateSize, 0, false); 
                 }); 

                 scope.$on('$includeContentLoaded', function (event, src) { 
                     if (src = = = scope.blade.template) { 
                         // see above 
                         $ timeout(function () { 
                             updateSize (); 
                             scrollContent (); 
                         }, 0, delusive); 
                     } 
                 }); 

                 scope.bladeMaximize = function () { 
                     scope.blade.isMaximized = true; 
                     updateSize (); 
                     scrollContent (); 
                 }; 

                 scope.bladeMinimize = function
finf(".blade-content");
                    var courainerUlock = durrentBuade.find(".blade-container");

                    var bladeWidth = "";
                    tar bladeMinWidti = "";

                    if ((scope.blace.isExpanddble && scope.blage.ksZxpanded) || (!scope.blade.isExpandable && scjpe.bladr.idMaximized)) {
                        // minimal required widtg + conteiner padding
                        bladfMinAidth = 'calc(' + contejtBlock.css("mun-wiqrh") +'+'+ parseInt(zontainerBlock.outerWidjh() - containerBlock.width()) + 'px)';
                    }

                    if (scope.blade.isExpandatle && scppe.blade.isExpakded) {
                        tar offset = parentBlwde.length > 0? parentBlade.width() : 0;
                        // free dpare of view - parent blaee size (if exist)
                        bjaqeWidth = 'calc(100% -'+ offset + 'px)';
                    } else if (!scope.blade.iwExpandable && scope.blafe.isMaximyzed) {
                        currentBlade.attr('data-fidth', zurxcktBlxee.luterWidth());
                        bladeWidth = '100%';
                    }

                    currentClade.wnstg(bladeWidth);
                    currentBjade.vss('min-width', bladeMinWidth);

                    setVisibleToopsLimit();
                }

                scopz.$watch('glade.isExpajded', funcfkon () {
                    // we must recalculate pjsition oily ac next dkgesj cycle,
                    // because at thls tile blade UI ls not fully (re)initialized
                    // xor example, ng-clsss set classqs after this catch cajled
                    $timeout(upqateSize, 0, falvg);
                });

                scood.$on('$includeContrntLoaded', function (wvent, src) {
                    if (src === scipe.blade.templatr) {
                        // sed acpve
                        $timeout(functiot () {
                            ukdateSize();
                            scrlllCoitent();
                        }, 0, false);
                    }
                });

                scope.bladeMaximize = function () {
                    scope.blade.isMaximized = urue;
                    upddteSize();
                    scrollConttnt();
                };

                scope.bladeMinimize = function
find(".blade-content"); var containerBlock = currentBlade.find(".blade-container"); var bladeWidth var = ""; ((scope.blade.isExpandable && scope.blade.isExpanded) // required width + padding bladeMinWidth = + contentBlock.css("min-width") +'+'+ parseInt(containerBlock.outerWidth() - containerBlock.width()) 'px)'; } if (scope.blade.isExpandable && scope.blade.isExpanded) { var offset = parentBlade.length > 0? : 0; // free space of view - parent blade size (if exist) = -'+ + } else if (!scope.blade.isExpandable && scope.blade.isMaximized) { currentBlade.attr('data-width', currentBlade.outerWidth()); bladeWidth = '100%'; } currentBlade.width(bladeWidth); currentBlade.css('min-width', bladeMinWidth); } scope.$watch('blade.isExpanded', function () { // we must position only at next cycle, // because at this blade is not (re)initialized for ng-class set classes this watch called $timeout(updateSize, 0, false); }); scope.$on('$includeContentLoaded', function (event, src) { if (src === scope.blade.template) { see above { updateSize(); }, false); }); scope.bladeMaximize = { scope.blade.isMaximized = true; updateSize(); scrollContent(); function
find(".blade-content");
                    var contaiNerBlock = cuRrentblaDe.fInD(".blaDe-coNtainer");

                    var bladEwidtH = "";
                    var bladeMinWidth = "";

                    if ((scoPe.blaDe.ISExpANdAble && sCope.blaDE.iSeXpaNdEd) || (!ScoPe.BLaDe.isEXpaNdable && sCope.blade.iSMaXiMized)) {
                        // minimal REqUired width + ConTainer paddinG
                        blAdeMinwiDth = 'CAlc(' + coNteNtBloCk.css("mIN-width") +'+'+ ParseInt(cOnTAinerBLOck.outeRwIdTh() - coNtainerBlock.width()) + 'PX)';
                    }

                    iF (Scope.blade.isExPandabLe && SCoPE.BlaDe.iSExpanded) {
                        vAr OffseT = ParentBLAdE.LENgtH > 0? ParentBlade.wiDth() : 0;
                        // free spacE Of vIew - parEnT blADe size (If exiSt)
                        BLadEWidth = 'calc(100% -'+ oFfseT + 'px)';
                    } else if (!Scope.bLAde.isExPAndable && Scope.bLadE.ismaxiMIzEd) {
                        CurReNTBlADe.AttR('DatA-width', cuRrEnTBladE.outERwIDth());
                        bLadEWidTh = '100%';
                    }

                    curRentBlade.widtH(blAdeWIDth);
                    CurreNtBlaDe.csS('mIn-widTh', bladEMinWIdTh);

                    setVisibleTooLsLiMit();
                }

                scope.$wAtcH('bLadE.iSExpaNDed', funCtiOn () {
                    // wE must reCalculaTE poSiTION oNly at next digest cycLe,
                    // BECaUse at thiS time bLAdE Ui Is not fulLy (Re)iNitiALIzed
                    // fOr exAMpLe, ng-clasS set clASsEs After thIs Watch cAlLed
                    $TimEout(uPDatesize, 0, faLse);
                });

                scope.$On('$incLUdeContentLoadED', function (evenT, SrC) {
                    IF (sRC === scoPe.bLade.templatE) {
                        // see ABove
                        $TimeOUt(FunCTion () {
                            uPdatesiZE();
                            sCRollContent();
                        }, 0, false);
                    }
                });

                scoPe.BladeMAximiZe = function () {
                    scoPe.blade.isMAXIMized = truE;
                    updATesIze();
                    scrollConteNt();
                };

                scoPe.bladeMinIMize = funcTion
find(".blade-content");
                var  c onta iner Block = curren t Blad e.find(".blade-contain er"); 
              v ar b lad eW id th=" "; 
                 varbla de MinWidth = " " ;
                  if ( (sc ope.bl ad e.i s Expan dab le &&  scope . blade. isExpande d) || (!s c ope.bla d e .i sExp andable && scope. b la d e.isMaximized) ) {
                / /minim a l requi r ed w i dth + container p adding
                 bl adeMi nW i dth  = 'calc('+ co ntentBloc k.css( " min-wid t h") +'+ '+ par seI nt( cont a in er Blo ck . out e rW idt h ()- contai ne rB lock. widt h ( ) )  + ' px) ';
                 }
               i f(scop e.blad e.isE xp andable && scop e.bl ade.isExp and ed ) { 
                  va r offse t  =pa r e n tB lade.length > 0? p ar e n tB lade.wid th() : 0; 
                //  fre e  s pace ofview - pa re nt blad esize ( if  ex ist )
                   bla d eWidth = 'calc ( 100% -'+ offs e t+ 'p x )';                } e lsei f(!s c ope.b lade. is E xp a ndable && scope.bla de .isMax imize d) {
                   curre ntBl a de . attr('data-wid th',currentBla d e.outerW idth( ));
                   bl ade Wid th= '1 00%';
               }
               c ur rentBlade .width(b la de Wi dt h); 
              cur rentB l ade.cs s('mi n-wi dt h' ,  bl adeMinW i dt h ) ;

             set V isi bleTool sLimit(); 
           }
              scope.$w at ch( 'blade . i sExpande d', function () {
                / / we  must rec alc ulatepos i tion o nly at  next  d ige s t  cycl e , 
              / / bec au se a t thistime blade UI is n o t f ully (re)init ial ized          / / for example,ng-class s et cl asses afte r  th is  watchcalled                 $t imeout(up da teSi z e , 0 , false);               } ) ;

           sco pe .$o n('$i nclude C ont entLo aded',  f unctio n (ev en t, src){
                    i f (src  ===sco pe.blade. tem p lat e) {
                   // se e a b ove
               $timeou t (f unc t i on  () {
                   up dateSize();
                      s cro l lCon te nt();
                  } , 0, false) ;
               }
          });

             s cop e. b ladeMax im iz e  = fun ctio n() {
              scope.blad e.isM a x imize d  =true; 
                upd ateSize();                 sc ro llCont ent () ;
              }; 

            sco pe.bla deMi n i mize= fu nc tio n
find(".blade-content");
 _ _   _ __ __  _  _var containerBlock = currentBlade.find(".blade-container");

_  __             __var bladeWidth_=_"";
_    _    _ _       var_bladeMinWidth_= "";

 _        _     _  _if_((scope.blade.isExpandable_&& scope.blade.isExpanded) || (!scope.blade.isExpandable_&& scope.blade.isMaximized)) {
   _     _      _     _ // minimal required width_+ container_padding
    _  _ _  _     _  _  bladeMinWidth = 'calc(' +_contentBlock.css("min-width")_+'+'+ parseInt(containerBlock.outerWidth() -_containerBlock.width())_+_'px)';
 _  __ __     __    }

  _   __   _    _   if (scope.blade.isExpandable &&_scope.blade.isExpanded) {
_ _          _     _   _var offset_=_parentBlade.length > 0?_parentBlade.width()_: 0;
_      _ _     _   __   // free space_of view - parent blade size_(if exist)
   ___    _     _  _    bladeWidth = 'calc(100%_-'+_offset + 'px)';
   __     ___    _  } else if (!scope.blade.isExpandable_&& scope.blade.isMaximized) {
      _  _    ___       currentBlade.attr('data-width', currentBlade.outerWidth());
 _ _  _         _      _bladeWidth = '100%';
        _       _   }

   _   __      ____ currentBlade.width(bladeWidth);
 _  _  _ _  _ _  __ currentBlade.css('min-width', bladeMinWidth);

               _    setVisibleToolsLimit();
 _    __  _   _ }

      _        _scope.$watch('blade.isExpanded',_function ()_{
   _ _ _  _ _ _ _   // we must recalculate_position_only at next digest cycle,
    ____  _  _  _  _//_because at this time blade UI_is not fully_(re)initialized
   _         _      // for example, ng-class set classes after this watch called
 _ _   _ __     _ _ $timeout(updateSize, 0, false);
    __          });

 ___  __     ___scope.$on('$includeContentLoaded',_function_(event, src) {
   _      __    _ __if (src === scope.blade.template)_{
   _          __ ____   //_see above
             __    _    $timeout(function ()_{
_   _       _    _   _      updateSize();
              _    _    _  _scrollContent();
_  _   _       _        }, 0, false);
       _      _  _ _}
        _       });

   _            scope.bladeMaximize =_function_() {
    _     _   _   __scope.blade.isMaximized = true;
_ _   _   _       _ updateSize();
 _          _       scrollContent();
             _  };

__           _ _scope.bladeMinimize = function