@teipublisher/pb-components 1.28.0 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/pb-components-bundle.js +106 -106
- package/package.json +1 -1
- package/src/pb-view.js +10 -1
package/package.json
CHANGED
package/src/pb-view.js
CHANGED
|
@@ -496,6 +496,15 @@ export class PbView extends pbMixin(LitElement) {
|
|
|
496
496
|
|
|
497
497
|
_refresh(ev) {
|
|
498
498
|
if (ev && ev.detail) {
|
|
499
|
+
if (ev.detail.hash && !(ev.detail.id || ev.detail.path || ev.detail.odd || ev.detail.view || ev.detail.position)) {
|
|
500
|
+
// if only the scroll target has changed: scroll to the element without reloading
|
|
501
|
+
this._scrollTarget = ev.detail.hash;
|
|
502
|
+
const target = this.shadowRoot.getElementById(this._scrollTarget);
|
|
503
|
+
if (target) {
|
|
504
|
+
setTimeout(() => target.scrollIntoView());
|
|
505
|
+
}
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
499
508
|
if (ev.detail.path) {
|
|
500
509
|
const doc = this.getDocument();
|
|
501
510
|
doc.path = ev.detail.path;
|
|
@@ -641,7 +650,7 @@ export class PbView extends pbMixin(LitElement) {
|
|
|
641
650
|
if (target) {
|
|
642
651
|
setTimeout(() => {
|
|
643
652
|
target.scrollIntoView();
|
|
644
|
-
});
|
|
653
|
+
}, 100);
|
|
645
654
|
}
|
|
646
655
|
this._scrollTarget = null;
|
|
647
656
|
});
|