src/cm/media/js/client/c_sync.js
changeset 491 50eeeb10e960
parent 490 57c1ba71f642
child 492 5b5245f4fe9a
equal deleted inserted replaced
490:57c1ba71f642 491:50eeeb10e960
   446             CY.get('document').set('scrollTop', 0) ; 
   446             CY.get('document').set('scrollTop', 0) ; 
   447           }
   447           }
   448           else {
   448           else {
   449             gIComments.activate(commentDbIds[0]) ;
   449             gIComments.activate(commentDbIds[0]) ;
   450             var scopeStart = CY.get(".c-id-"+commentDbIds[0]) ;
   450             var scopeStart = CY.get(".c-id-"+commentDbIds[0]) ;
   451             if (scopeStart && !scopeStart.inViewportRegion()) // scopeStart could be null when comment has no scope
   451             if (scopeStart && !scopeStart.inViewportRegion()) { // scopeStart could be null when comment has no scope
       
   452               // Since scrollIntoView scroll the embed iframe *and* the parent window
       
   453               // save the position of the toolbar
       
   454               if (parent)
       
   455                 window_pos = parent.document.getElementById('outer-north').scrollTop
   452               scopeStart.scrollIntoView(true) ;
   456               scopeStart.scrollIntoView(true) ;
       
   457               // Since scrollIntoView scroll the embed ifram *and* the parent window
       
   458               // restore the position of the toolbar
       
   459               if (window_pos)
       
   460                 parent.document.getElementById('outer-north').scrollTop(window_pos) ;
       
   461             }
   453           }
   462           }
   454         }
   463         }
   455         
   464         
   456         gIComments.setPosition([gConf['iCommentLeftPadding'], topY]) ;
   465         gIComments.setPosition([gConf['iCommentLeftPadding'], topY]) ;
   457   
   466