fixed pagination

This commit is contained in:
Rafał Jaworski 2019-01-18 14:55:34 +01:00
parent 785cb81386
commit e4b4a77de3
4 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,10 @@
var pageLimit = 20; var pageLimit = 20;
function secondStepSearch(fragment) { function secondStepSearch(fragment, resetOffset=false) {
if (resetOffset) {
$('#current-offset').val(0);
}
var searchQuery = $('body').data('current_fragment'); var searchQuery = $('body').data('current_fragment');
if (typeof(fragment) !== "undefined") { if (typeof(fragment) !== "undefined") {
searchQuery = fragment; searchQuery = fragment;
@ -193,7 +196,7 @@ function renderResult(data) {
//the marked fragment //the marked fragment
var textFragment = htmlEncode(inputSentence.slice(fragment['matchedPatternStart'], fragment['matchedPatternEnd'])); var textFragment = htmlEncode(inputSentence.slice(fragment['matchedPatternStart'], fragment['matchedPatternEnd']));
markedSentence += '<span onclick="secondStepSearch(this.innerHTML)" class="matchedFragment">'+textFragment+'</span>'; markedSentence += '<span onclick="secondStepSearch(this.innerHTML, true)" class="matchedFragment">'+textFragment+'</span>';
lastInsertedEnd = fragment['matchedPatternEnd']; lastInsertedEnd = fragment['matchedPatternEnd'];

View File

@ -175,7 +175,6 @@ ExampleOccurence UnitDAO::_getExampleOccurence(DBconnection & connection, const
} }
} }
int prevPos = -2; int prevPos = -2;
int currStart = -1; int currStart = -1;
int currEnd = -1; int currEnd = -1;

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
psql -U concordia concordia_server PGPASSWORD=concordia psql -U concordia concordia_server

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
psql -U concordia -p 6543 -h localhost concordia_server PGPASSWORD=concordia psql -U concordia -p 6543 -h localhost concordia_server