Feature parity with old implementation

This commit is contained in:
Stephan Porada
2020-09-08 10:42:39 +02:00
parent 521fd72d9b
commit ccfbf852b2
5 changed files with 97 additions and 147 deletions

View File

@ -123,8 +123,9 @@ document.addEventListener("DOMContentLoaded", () => {
'dynamicMode': true});
/**
* Initializing the results object as a model holding all the data of a query.
* Also holds the metadata of one query. After that initialize the ResultsList
* object as the View handeling the represnetation of the data.
* Also holds the metadata of one query.
* After that initialize the ResultsList object as the View handeling the
* represnetation of the data for the user.
*/
let results = new Results();
let resultsList = new ResultsList('result-list', ResultsList.options);
@ -174,7 +175,7 @@ document.addEventListener("DOMContentLoaded", () => {
listenForResults]);
client.loadSocketEventListeners();
/**
* Register resultsList listeners listening to nitification events.
* Register resultsList listeners listening to notification events.
*/
const listenForClientNotification = new ViewEventListener('notify-view',
recieveClientNotification);
@ -221,7 +222,28 @@ document.addEventListener("DOMContentLoaded", () => {
'#query-results-download-modal',
'#query-results-table',
'#display-options-form-expert_mode',
'.pagination',
]);
/**
* The following listener handles what functions are called when the user
* does use the page navigation to navigate to a new page.
*/
for (let element of resultsList.pagination) {
element.addEventListener("click", (event) => {
// shows match context according to the user picked value
resultsList.changeContext();
// activates or deactivates expertMode on new page depending switch value
if (resultsList.displayOptionsFormExpertMode.checked) {
resultsList.expertModeOn('query-display', results);
} else {
resultsList.expertModeOff('query-display');
}
// activates inspect buttons on new page if client is not busy
resultsList.activateInspect();
});
}
/**
* The following event Listener handles the expert mode switch for the list
*/