diff --git a/package.json b/package.json
index 7b2e6d49..b2beacee 100644
--- a/package.json
+++ b/package.json
@@ -33,6 +33,7 @@
"bootstrap": "^4",
"file-saver": "^2.0.2",
"ngx-bootstrap": "^18",
+ "ngx-intersection-observer": "^1.0.13",
"ngx-page-scroll": "^13",
"ngx-page-scroll-core": "^13",
"ngx-toastr": "^19",
diff --git a/src/app/annotation-table-intersection-event.ts b/src/app/annotation-table-intersection-event.ts
new file mode 100644
index 00000000..a678500d
--- /dev/null
+++ b/src/app/annotation-table-intersection-event.ts
@@ -0,0 +1,4 @@
+export class AnnotationTableIntersection {
+ constructor(public annotationTypeName: string,
+ public isIntersecting: boolean) {}
+}
diff --git a/src/app/annotation-table/annotation-table.component.html b/src/app/annotation-table/annotation-table.component.html
index 3374a5c3..be4fa8cf 100644
--- a/src/app/annotation-table/annotation-table.component.html
+++ b/src/app/annotation-table/annotation-table.component.html
@@ -41,7 +41,9 @@
-
+
-
0">
+
0"
+ intersectionObserver
+ (intersection)="intersectHandler(annotationTypeName + '-' + conf.config_name, $event.intersect)">
{{capitalize(conf.display_name)}}
;
@Input() geneDetails?: GeneDetails;
@Input() scope: string; // "gene", "term", "reference" ...
+ @Output() annotationTableIntersection = new EventEmitter();
config: AnnotationTableConfig = getAnnotationTableConfig();
typeConfig: AnnotationType;
@@ -89,6 +91,10 @@ export class AnnotationTableComponent implements OnInit, OnChanges {
ngOnInit() {
}
+ intersectHandler(subTableName: string, isIntersecting: boolean) {
+ this.annotationTableIntersection.emit(new AnnotationTableIntersection(subTableName, isIntersecting));
+ }
+
ngOnChanges() {
this.typeConfig = this.config.getAnnotationType(this.annotationTypeName);
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 5db4b095..c2c952fe 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -164,6 +164,9 @@ import { GeneticInteractionTableTypeFilterComponent } from './genetic-interactio
import { RnaStructureComponent } from './rna-structure/rna-structure.component';
import { ProteinFeatureTableComponent } from './protein-feature-table/protein-feature-table.component';
+import { IntersectionObserverModule } from 'ngx-intersection-observer';
+import { IntersectionObserverConfig } from 'ngx-intersection-observer/lib/intersection-observer-config.model';
+
@Pipe({
name: 'safeUrl',
standalone: false
@@ -319,7 +322,14 @@ export class PomBaseUrlSerializer extends DefaultUrlSerializer {
ProteinFeatureTableComponent,
],
bootstrap: [AppComponent],
- schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [BrowserModule,
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ imports: [
+ IntersectionObserverModule.forRoot({
+ debounce: 50,
+ threshold: 1,
+ autoRemove: true
+ } as IntersectionObserverConfig),
+ BrowserModule,
CommonModule,
BrowserAnimationsModule,
FormsModule,
diff --git a/src/app/gene-details/gene-details.component.html b/src/app/gene-details/gene-details.component.html
index 16dc0d4c..037fc84c 100644
--- a/src/app/gene-details/gene-details.component.html
+++ b/src/app/gene-details/gene-details.component.html
@@ -103,6 +103,7 @@
@@ -133,7 +134,10 @@
-
@@ -167,6 +180,8 @@
@@ -174,33 +189,49 @@
0"
+ intersectionObserver
+ (intersection)="intersect('transcript_view', $event.intersect)"
[geneDetails]="geneDetails">
diff --git a/src/app/gene-details/gene-details.component.ts b/src/app/gene-details/gene-details.component.ts
index 75ceba40..9e40bab0 100644
--- a/src/app/gene-details/gene-details.component.ts
+++ b/src/app/gene-details/gene-details.component.ts
@@ -17,6 +17,8 @@ import { DeployConfigService } from '../deploy-config.service';
import { Util } from '../shared/util';
import { MenuItem } from '../types';
+import { AnnotationTableIntersection } from '../annotation-table-intersection-event';
+
@Component({
selector: 'app-gene-details',
templateUrl: './gene-details.component.html',
@@ -32,6 +34,7 @@ export class GeneDetailsComponent implements OnInit {
annotationTypeOrder: Array = [];
annotationTypeOrderNames: Array = [];
menuItems: Array