File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed
Expand file tree Collapse file tree 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 {
12501250 this . sectionProperties . selectedComment . hide ( ) ;
12511251 }
12521252
1253- this . update ( ) ;
1253+ var previousAnimationState = this . disableLayoutAnimation ;
1254+ this . disableLayoutAnimation = true ;
1255+ this . update ( true ) ;
1256+ this . disableLayoutAnimation = previousAnimationState ;
12541257 }
12551258
12561259 private showHideComments ( ) : void {
@@ -2010,8 +2013,8 @@ export class CommentSection extends app.definitions.canvasSectionObject {
20102013 this . disableLayoutAnimation = false ;
20112014 }
20122015
2013- private layout ( zoom : any = null ) : void {
2014- if ( zoom )
2016+ private layout ( immediate : any = null ) : void {
2017+ if ( immediate )
20152018 this . doLayout ( ) ;
20162019 else if ( ! this . sectionProperties . layoutTimer ) {
20172020 this . sectionProperties . layoutTimer = setTimeout ( function ( ) {
@@ -2021,10 +2024,10 @@ export class CommentSection extends app.definitions.canvasSectionObject {
20212024 } // else - avoid excessive re-layout
20222025 }
20232026
2024- private update ( ) : void {
2027+ private update ( immediate : boolean = false ) : void {
20252028 if ( this . sectionProperties . docLayer . _docType === 'text' )
20262029 this . updateThreadInfoIndicator ( ) ;
2027- this . layout ( ) ;
2030+ this . layout ( immediate ) ;
20282031 }
20292032
20302033 private updateThreadInfoIndicator ( ) : void {
Original file line number Diff line number Diff line change @@ -337,9 +337,10 @@ export class Comment extends CanvasSectionObject {
337337 lastPosY = childPositions [ i ] . posY + 24 ;
338338 }
339339 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 ++ ) {
341341 this . sectionProperties . childLinesNode . removeChild ( this . sectionProperties . childLines [ i ] ) ;
342- this . sectionProperties . childLines . splice ( i ) ;
342+ this . sectionProperties . childLines . splice ( i ) ;
343+ }
343344 }
344345
345346 }
Original file line number Diff line number Diff line change @@ -16,6 +16,17 @@ L.PosAnimation = L.Class.extend({
1616
1717 this . fire ( 'start' ) ;
1818
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+
1930 el . style [ L . DomUtil . TRANSITION ] = 'all ' + ( isNaN ( duration ) ? 0.25 : 0 ) +
2031 's cubic-bezier(0,0,' + ( easeLinearity || 0.5 ) + ',1)' ;
2132
You can’t perform that action at this time.
0 commit comments