@@ -425,8 +425,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
425425            this . activeDatasetId  =  null ; 
426426            this . datesetTitleFormater  =  new  DatasetTitleFormater ( this ) ; 
427427            this . options . bodyMarginBottomHeight  =  parseInt ( $ ( 'body' ) . css ( 'margin-bottom' ) ) ; 
428-             this . hasParent  =  window . parent  &&  window . parent  !==  window . top 
429-                 &&  window . parent . phpdebugbar  &&  window . parent . phpdebugbar  !=  this ; 
428+             this . isIframe  =  window . self  !==  window . top ; 
430429            this . registerResizeHandler ( ) ; 
431430        } , 
432431
@@ -436,7 +435,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
436435         * @this  {DebugBar} 
437436         */ 
438437        registerResizeHandler : function ( )  { 
439-             if  ( typeof  this . resize . bind  ==  'undefined'  ||  this . hasParent )  return ; 
438+             if  ( typeof  this . resize . bind  ==  'undefined'  ||  this . isIframe )  return ; 
440439
441440            var  f  =  this . resize . bind ( this ) ; 
442441            this . respCSSSize  =  0 ; 
@@ -477,7 +476,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
477476         * @this  {DebugBar} 
478477         */ 
479478        render : function ( )  { 
480-             if  ( this . hasParent )  { 
479+             if  ( this . isIframe )  { 
481480                this . $el . hide ( ) ; 
482481            } 
483482
@@ -580,7 +579,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
580579         * @this  {DebugBar} 
581580         */ 
582581        restoreState : function ( )  { 
583-             if  ( this . hasParent )  return ; 
582+             if  ( this . isIframe )  return ; 
584583            // bar height 
585584            var  height  =  localStorage . getItem ( 'phpdebugbar-height' ) ; 
586585            this . setHeight ( height  ||  this . $body . height ( ) ) ; 
@@ -934,12 +933,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
934933         * @return  {String } Dataset's id 
935934         */ 
936935        addDataSet : function ( data ,  id ,  suffix ,  show )  { 
937-             if  ( this . hasParent )  { 
938-                 if  ( ! suffix  ||  ( '(iframe)' ) . indexOf ( suffix )  <  0 )  { 
939-                     suffix  =  '(iframe)'  +  ( suffix  ||  '' ) ; 
940-                 } 
941- 
942-                 window . parent . phpdebugbar . addDataSet ( data ,  id ,  suffix ,  show ) ; 
936+             if  ( this . isIframe )  { 
937+                 window . top . phpdebugbar . addDataSet ( data ,  id ,  '(iframe)'  +  ( suffix  ||  '' ) ,  show ) ; 
943938                return ; 
944939            } 
945940
0 commit comments