Open tuurma opened 1 year ago
I was able to reproduce the incorrect URL by clicking the "Normalised View" checkbox in the top toolbar.
I found the code that is responsible for adding the selectors to the URL. It is PbView.toggleFeature(ev)
.
registry.getState(this)
will return the array of selectors among all other properties. These properties are then used in a call to registry.commit()
which adds the selectors to the URL.
By simply removing the selectors from the properties before calling registry.commit()
does keep the URL clean and the state can be toggled.
// shield URL from selectors
delete properties.selectors
Side note: Initial toggle states are not picked up properly in the client-side demo.
The selectors property is sometimes stored in state and sometimes only in channelState from what I gather.
Selecting configuration with pb-toggle-feature or pb-select-feature adjusts the URL to include
selectors=....
section which prevents the page from being reloaded correctlyCompare
https://teipublisher.com/exist/apps/tei-publisher/test/lelewel1.xml?view=page&norm=off&odd=lelewel
vs
https://teipublisher.com/exist/apps/tei-publisher/test/lelewel1.xml?view=page&norm=on&odd=lelewel&selectors=%5Bobject+Object%5D