src/cm/media/js/client/c_sync.js
changeset 491 50eeeb10e960
parent 490 57c1ba71f642
child 492 5b5245f4fe9a
--- a/src/cm/media/js/client/c_sync.js	Sat Jan 26 11:03:23 2013 +0100
+++ b/src/cm/media/js/client/c_sync.js	Sun Jan 27 11:19:55 2013 +0100
@@ -448,8 +448,17 @@
           else {
             gIComments.activate(commentDbIds[0]) ;
             var scopeStart = CY.get(".c-id-"+commentDbIds[0]) ;
-            if (scopeStart && !scopeStart.inViewportRegion()) // scopeStart could be null when comment has no scope
+            if (scopeStart && !scopeStart.inViewportRegion()) { // scopeStart could be null when comment has no scope
+              // Since scrollIntoView scroll the embed iframe *and* the parent window
+              // save the position of the toolbar
+              if (parent)
+                window_pos = parent.document.getElementById('outer-north').scrollTop
               scopeStart.scrollIntoView(true) ;
+              // Since scrollIntoView scroll the embed ifram *and* the parent window
+              // restore the position of the toolbar
+              if (window_pos)
+                parent.document.getElementById('outer-north').scrollTop(window_pos) ;
+            }
           }
         }