File tree Expand file tree Collapse file tree
assets/javascripts/Annotations
javascript/Components/Result Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626- Fix tag creation failing in tags table (#7426 )
2727- Ensure tag names are unique within an assignment (#7430 )
2828- Update flash style to "notice" for "setting up test env" message (#7445 )
29+ - Fixed bug in ` ImageViewer ` where image width was set to 0 on initial load (#7485 )
30+ - Fixed bug in ` ImageViewer ` where annotations did not disappear when moving the mouse out of the image (#7485 )
2931
3032### 🔧 Internal changes
3133
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ class ImageAnnotationManager extends AnnotationManager {
7777 } else {
7878 holder . style . cursor = "auto" ;
7979 }
80+ holder . onmouseleave = this . check_for_annotations . bind ( this ) ;
8081
8182 this . image_preview . parentNode . insertBefore ( holder , this . image_preview ) ;
8283 }
@@ -201,6 +202,7 @@ class ImageAnnotationManager extends AnnotationManager {
201202 holder . onmousemove = this . check_for_annotations . bind ( this ) ;
202203 holder . onmousedown = this . start_select_box . bind ( this ) ;
203204 holder . onmouseup = null ;
205+ holder . onmouseleave = this . check_for_annotations . bind ( this ) ;
204206 }
205207 }
206208
Original file line number Diff line number Diff line change @@ -26,13 +26,7 @@ export class ImageViewer extends React.PureComponent {
2626 }
2727
2828 componentDidMount ( ) {
29- this . setImageURL ( ) . then ( ( ) => {
30- document . getElementById ( "image_preview" ) . onload = ( ) => {
31- this . display_annotations ( ) ;
32- this . adjustPictureSize ( ) ;
33- this . rotateImage ( ) ;
34- } ;
35- } ) ;
29+ this . setImageURL ( ) ;
3630 }
3731
3832 componentWillUnmount ( ) {
@@ -231,7 +225,11 @@ export class ImageViewer extends React.PureComponent {
231225 src = { this . state . url }
232226 data-zoom = { this . state . zoom }
233227 className = { this . props . released_to_students ? "" : "enable-annotations" }
234- onLoad = { this . display_annotations }
228+ onLoad = { ( ) => {
229+ this . display_annotations ( ) ;
230+ this . adjustPictureSize ( ) ;
231+ this . rotateImage ( ) ;
232+ } }
235233 alt = { I18n . t ( "results.cant_display_image" ) }
236234 />
237235 </ div >
You can’t perform that action at this time.
0 commit comments