File tree 3 files changed +22
-7
lines changed
3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -1250,7 +1250,10 @@ export class CommentSection extends app.definitions.canvasSectionObject {
1250
1250
this . sectionProperties . selectedComment . hide ( ) ;
1251
1251
}
1252
1252
1253
- this . update ( ) ;
1253
+ var previousAnimationState = this . disableLayoutAnimation ;
1254
+ this . disableLayoutAnimation = true ;
1255
+ this . update ( true ) ;
1256
+ this . disableLayoutAnimation = previousAnimationState ;
1254
1257
}
1255
1258
1256
1259
private showHideComments ( ) : void {
@@ -2010,8 +2013,8 @@ export class CommentSection extends app.definitions.canvasSectionObject {
2010
2013
this . disableLayoutAnimation = false ;
2011
2014
}
2012
2015
2013
- private layout ( zoom : any = null ) : void {
2014
- if ( zoom )
2016
+ private layout ( immediate : any = null ) : void {
2017
+ if ( immediate )
2015
2018
this . doLayout ( ) ;
2016
2019
else if ( ! this . sectionProperties . layoutTimer ) {
2017
2020
this . sectionProperties . layoutTimer = setTimeout ( function ( ) {
@@ -2021,10 +2024,10 @@ export class CommentSection extends app.definitions.canvasSectionObject {
2021
2024
} // else - avoid excessive re-layout
2022
2025
}
2023
2026
2024
- private update ( ) : void {
2027
+ private update ( immediate : boolean = false ) : void {
2025
2028
if ( this . sectionProperties . docLayer . _docType === 'text' )
2026
2029
this . updateThreadInfoIndicator ( ) ;
2027
- this . layout ( ) ;
2030
+ this . layout ( immediate ) ;
2028
2031
}
2029
2032
2030
2033
private updateThreadInfoIndicator ( ) : void {
Original file line number Diff line number Diff line change @@ -337,9 +337,10 @@ export class Comment extends CanvasSectionObject {
337
337
lastPosY = childPositions [ i ] . posY + 24 ;
338
338
}
339
339
if ( i < this . sectionProperties . childLines . length ) {
340
- for ( let j = i ; j < this . sectionProperties . childLines . length ; j ++ )
340
+ for ( let j = i ; j < this . sectionProperties . childLines . length ; j ++ ) {
341
341
this . sectionProperties . childLinesNode . removeChild ( this . sectionProperties . childLines [ i ] ) ;
342
- this . sectionProperties . childLines . splice ( i ) ;
342
+ this . sectionProperties . childLines . splice ( i ) ;
343
+ }
343
344
}
344
345
345
346
}
Original file line number Diff line number Diff line change @@ -16,6 +16,17 @@ L.PosAnimation = L.Class.extend({
16
16
17
17
this . fire ( 'start' ) ;
18
18
19
+ // Skip some work if the duration is zero
20
+ if ( duration <= 0 ) {
21
+ el . style [ L . DomUtil . TRANSITION ] = '' ;
22
+ L . DomUtil . setPosition ( el , newPos ) ;
23
+ this . _el . _leaflet_pos = newPos ;
24
+ this . _inProgress = false ;
25
+ this . fire ( 'step' ) . fire ( 'end' ) ;
26
+ this . _el . dataset . transitioning = false ;
27
+ return ;
28
+ }
29
+
19
30
el . style [ L . DomUtil . TRANSITION ] = 'all ' + ( isNaN ( duration ) ? 0.25 : 0 ) +
20
31
's cubic-bezier(0,0,' + ( easeLinearity || 0.5 ) + ',1)' ;
21
32
You can’t perform that action at this time.
0 commit comments