mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
[CST-5270] fixed accordion issue and changed it to collapsable
This commit is contained in:
@@ -27,8 +27,6 @@ import { debounce, debounceTime, timeInterval } from 'rxjs/operators';
|
||||
@renderSectionFor(SectionsType.SherpaPolicies)
|
||||
export class SubmissionSectionSherpaPoliciesComponent extends SectionModelComponent {
|
||||
|
||||
@ViewChildren('acc', { emitDistinctChangesOnly: true }) acc: QueryList<any>;
|
||||
|
||||
/**
|
||||
* The accesses section data
|
||||
* @type {WorkspaceitemSectionAccessesObject}
|
||||
@@ -47,6 +45,11 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon
|
||||
*/
|
||||
protected subs: Subscription[] = [];
|
||||
|
||||
/**
|
||||
* A boolean representing if div should start collapsed
|
||||
*/
|
||||
public isCollapsed = false;
|
||||
|
||||
/**
|
||||
* Initialize instance variables
|
||||
*
|
||||
@@ -74,17 +77,6 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon
|
||||
.forEach((subscription) => subscription.unsubscribe());
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand all primary accordions
|
||||
*/
|
||||
ngAfterViewInit() {
|
||||
if (this.acc) {
|
||||
this.acc.forEach(accordion => {
|
||||
accordion.expandAll();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize all instance variables and retrieve collection default access conditions
|
||||
@@ -98,18 +90,6 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon
|
||||
this.sherpaPoliciesData$.next(sherpaPolicies);
|
||||
})
|
||||
);
|
||||
|
||||
this.subs.push(
|
||||
this.sherpaPoliciesData$.pipe(
|
||||
debounceTime(500)
|
||||
).subscribe((sherpaPolicies: WorkspaceitemSectionSherpaPoliciesObject) => {
|
||||
if (this.acc) {
|
||||
this.acc.forEach(accordion => {
|
||||
accordion.expandAll();
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user