src/cm/media/js/client/c_sync.js
changeset 492 5b5245f4fe9a
parent 491 50eeeb10e960
child 501 5cd02f32be5e
equal deleted inserted replaced
491:50eeeb10e960 492:5b5245f4fe9a
   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
       
   456               scopeStart.scrollIntoView(true) ;
   452               scopeStart.scrollIntoView(true) ;
   457               // Since scrollIntoView scroll the embed ifram *and* the parent window
   453               // Since scrollIntoView scroll the embed ifram *and* the parent window
   458               // restore the position of the toolbar
   454               // restore the position of the toolbar
   459               if (window_pos)
   455               if (parent)
   460                 parent.document.getElementById('outer-north').scrollTop(window_pos) ;
   456                 parent.document.getElementById('outer-north').scrollIntoView(true) ;
   461             }
   457             }
   462           }
   458           }
   463         }
   459         }
   464         
   460         
   465         gIComments.setPosition([gConf['iCommentLeftPadding'], topY]) ;
   461         gIComments.setPosition([gConf['iCommentLeftPadding'], topY]) ;