@@ -156,10 +156,10 @@ const TimeUI = {
156
156
return { dateString, additionalSeconds }
157
157
} ,
158
158
attachEvents : function ( timeChange ) {
159
- let startingModeIndex = TimeUI . modeIndex
159
+ TimeUI . _startingModeIndex = TimeUI . modeIndex
160
160
// Set modeIndex to 1/Point if a deeplink had an endtime but no starttime
161
161
if ( L_ . FUTURES . startTime == null && L_ . FUTURES . endTime != null )
162
- startingModeIndex = 1
162
+ TimeUI . _startingModeIndex = 1
163
163
164
164
// Timeline pan and zoom
165
165
// zoom
@@ -355,11 +355,11 @@ const TimeUI = {
355
355
356
356
if ( L_ . configData . time ?. startInPointMode == true ) {
357
357
TimeUI . modeIndex = TimeUI . modes . indexOf ( 'Point' )
358
- startingModeIndex = TimeUI . modeIndex
358
+ TimeUI . _startingModeIndex = TimeUI . modes . indexOf ( 'Point' )
359
359
}
360
360
// Mode dropdown
361
361
$ ( '#mmgisTimeUIModeDropdown' ) . html (
362
- Dropy . construct ( TimeUI . modes , 'Mode' , startingModeIndex , {
362
+ Dropy . construct ( TimeUI . modes , 'Mode' , TimeUI . _startingModeIndex , {
363
363
openUp : true ,
364
364
dark : true ,
365
365
} )
@@ -521,12 +521,6 @@ const TimeUI = {
521
521
null ,
522
522
true
523
523
)
524
-
525
- if ( L_ . configData . time ?. startInPointMode == true )
526
- TimeUI . changeMode ( TimeUI . modes . indexOf ( 'Point' ) )
527
- // Set modeIndex to 1/Point if a deeplink had an endtime but no starttime
528
- else if ( TimeUI . modeIndex != startingModeIndex )
529
- TimeUI . changeMode ( startingModeIndex )
530
524
} ,
531
525
fina ( ) {
532
526
let date
@@ -579,6 +573,12 @@ const TimeUI = {
579
573
if ( TimeUI . enabled ) {
580
574
TimeUI . _makeHistogram ( )
581
575
}
576
+
577
+ if ( L_ . configData . time ?. startInPointMode == true )
578
+ TimeUI . changeMode ( TimeUI . modes . indexOf ( 'Point' ) )
579
+ // Set modeIndex to 1/Point if a deeplink had an endtime but no starttime
580
+ else if ( TimeUI . modeIndex != TimeUI . _startingModeIndex )
581
+ TimeUI . changeMode ( TimeUI . _startingModeIndex )
582
582
} ,
583
583
changeMode ( idx ) {
584
584
TimeUI . modeIndex = idx
@@ -710,6 +710,7 @@ const TimeUI = {
710
710
_remakeTimeSlider ( ignoreHistogram ) {
711
711
const rangeMode =
712
712
TimeUI . modes [ TimeUI . modeIndex ] === 'Range' ? true : false
713
+
713
714
if ( TimeUI . timeSlider ) {
714
715
TimeUI . timeSlider . $destroy ( )
715
716
TimeUI . timeSlider = null
@@ -764,7 +765,6 @@ const TimeUI = {
764
765
TimeUI . timeSlider . $on ( 'change' , ( e ) => {
765
766
let idx = 0
766
767
if ( TimeUI . modes [ TimeUI . modeIndex ] === 'Point' ) idx -= 1
767
-
768
768
const date = new Date ( e . detail . value )
769
769
const offsetNowDate = new Date (
770
770
date . getTime ( ) + date . getTimezoneOffset ( ) * 60000
@@ -953,7 +953,7 @@ const TimeUI = {
953
953
if ( parsedStart != null && parsedEnd != null ) {
954
954
if ( offsetStartDate . getTime ( ) > offsetEndDate . getTime ( ) ) {
955
955
console . warn (
956
- `updateTimes: Cannot set start time after end time. ${ parsedStart } > ${ parseEnd } `
956
+ `updateTimes: Cannot set start time after end time. ${ parsedStart } > ${ parsedEnd } `
957
957
)
958
958
return false
959
959
}
@@ -1095,7 +1095,6 @@ const TimeUI = {
1095
1095
TimeUI . _endTimestamp != null
1096
1096
) {
1097
1097
const mode = TimeUI . modes [ TimeUI . modeIndex ]
1098
-
1099
1098
TimeUI . timeChange (
1100
1099
new Date (
1101
1100
mode === 'Range'
0 commit comments