View | Details | Raw Unified | Return to bug 28074
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/js/browser.js (-7 / +6 lines)
Lines 42-50 KOHA.browser = function (searchid, biblionumber) { Link Here
42
42
43
    me.create = function (offset, query, limit, sort, newresults, total) {
43
    me.create = function (offset, query, limit, sort, newresults, total) {
44
        if (current_search) {
44
        if (current_search) {
45
            if (offset === current_search.offset - newresults.length) {
45
            if (offset === parseInt(current_search.offset) - newresults.length) {
46
                current_search.results = newresults.concat(current_search.results);
46
                current_search.results = newresults.concat(current_search.results);
47
            } else if (searchOffset = current_search.offset + newresults.length) {
47
            } else if (searchOffset = parseInt(current_search.offset) + newresults.length) {
48
                current_search.results = current_search.results.concat(newresults);
48
                current_search.results = current_search.results.concat(newresults);
49
            } else {
49
            } else {
50
                delete current_search;
50
                delete current_search;
Lines 73-82 KOHA.browser = function (searchid, biblionumber) { Link Here
73
    me.show = function () {
73
    me.show = function () {
74
        if (current_search) {
74
        if (current_search) {
75
            me.curPos = $.inArray(biblionumber, current_search.results);
75
            me.curPos = $.inArray(biblionumber, current_search.results);
76
            if ( current_search.offset + me.curPos <= current_search.pagelen ) { // First page
76
            if ( parseInt(current_search.offset ) + me.curPos <= current_search.pagelen ) { // First page
77
                me.offset = 0;
77
                me.offset = 0;
78
            } else {
78
            } else {
79
                me.offset = current_search.offset - 1;
79
                me.offset = parseInt(current_search.offset) - 1;
80
            }
80
            }
81
81
82
            $(document).ready(function () {
82
            $(document).ready(function () {
Lines 84-95 KOHA.browser = function (searchid, biblionumber) { Link Here
84
                    var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset;
84
                    var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset;
85
                    var prevbutton;
85
                    var prevbutton;
86
                    var nextbutton;
86
                    var nextbutton;
87
                    if (me.curPos === 0 && current_search.offset === 1) {
87
                    if (me.curPos === 0 && parseInt(current_search.offset) === 1) {
88
                        prevbutton = '<span id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></span>';
88
                        prevbutton = '<span id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></span>';
89
                    } else {
89
                    } else {
90
                        prevbutton = '<a href="#" id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></a>';
90
                        prevbutton = '<a href="#" id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></a>';
91
                    }
91
                    }
92
                    if (current_search.offset + me.curPos == current_search.total) {
92
                    if (parseInt(current_search.offset) + me.curPos == current_search.total) {
93
                        nextbutton = '<span id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></span>';
93
                        nextbutton = '<span id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></span>';
94
                    } else {
94
                    } else {
95
                        nextbutton = '<a href="#" id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></a>';
95
                        nextbutton = '<a href="#" id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></a>';
96
- 

Return to bug 28074