Commit d267d8d 1 parent 8160a96 commit d267d8d Copy full SHA for d267d8d
File tree 3 files changed +4257
-4946
lines changed
plugins/linear-genome-view/src
LinearGenomeView/components
3 files changed +4257
-4946
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ function stateModelFactory() {
329
329
} ,
330
330
{
331
331
label : 'Collapse introns' ,
332
- onClick : ( ) => {
332
+ onClick : async ( ) => {
333
333
const { contextMenuFeature } = self
334
334
if ( contextMenuFeature ) {
335
335
const refName = contextMenuFeature . get ( 'refName' )
@@ -347,11 +347,24 @@ function stateModelFactory() {
347
347
assemblyName : view . assemblyNames [ 0 ] ,
348
348
} ) ) || [ ]
349
349
res . sort ( ( a , b ) => a . start - b . start )
350
- getSession ( self ) . addView ( 'LinearGenomeView' , {
351
- ...getSnapshot ( view ) ,
352
- id : nanoid ( ) ,
353
- displayedRegions : res ,
354
- } )
350
+
351
+ // need to strip ID before copying view snap
352
+ const { id, ...rest } = getSnapshot ( view )
353
+ const newView = getSession ( self ) . addView (
354
+ 'LinearGenomeView' ,
355
+ {
356
+ ...rest ,
357
+ id : nanoid ( ) ,
358
+ tracks : rest . tracks . map ( track => {
359
+ const { id, ...rest } = track
360
+ return { ...rest , id : nanoid ( ) }
361
+ } ) ,
362
+ displayedRegions : res ,
363
+ } ,
364
+ ) as LGV
365
+ await when ( ( ) => newView . initialized )
366
+
367
+ newView . showAllRegions ( )
355
368
}
356
369
} ,
357
370
} ,
Original file line number Diff line number Diff line change @@ -112,14 +112,11 @@ const Controls = ({ model }: { model: LGV }) => {
112
112
}
113
113
114
114
const LinearGenomeViewHeader = observer ( ( { model } : { model : LGV } ) => {
115
+ const Wrapper = model . hideHeaderOverview ? React . Fragment : OverviewScalebar
115
116
return ! model . hideHeader ? (
116
- model . hideHeaderOverview ? (
117
+ < Wrapper model = { model } >
117
118
< Controls model = { model } />
118
- ) : (
119
- < OverviewScalebar model = { model } >
120
- < Controls model = { model } />
121
- </ OverviewScalebar >
122
- )
119
+ </ Wrapper >
123
120
) : null
124
121
} )
125
122
You can’t perform that action at this time.
0 commit comments