rem: var offset = (curPage - 1) * itemsPerPage + 1; var end = offset + itemsPerPage - 1; if(items < end) { end = items; } setValue("tdb-item-start", offset); setValue("tdb-item-end", end); setValue("tdb-total-items", items); 
add: var offset = (curPage - 1) * itemsPerPage + 1; var end = offset + itemsPerPage - 1; if(items < end) { end = items; } setValue("tdb-item-start", offset); setValue("tdb-item-end", end); setValue("tdb-total-items", items); 
context: Mantissa.TDB.Controller.prototype._setPageState = function (hasPrevPage, hasNextPage, curPage, itemsPerPage, items) {    var cp = this._getHandyNode("tdb-control-panel");    var self = this;    if(items == 0) {        cp.style.display = "none";    } else {        cp.style.display = "table-cell";    }    function setValue(eid, value) {        var e = self._getHandyNode(eid);        if(e.childNodes.length == 0) {            e.appendChild(document.createTextNode(value));        } else {            e.firstChild.nodeValue = value;        }    }    var offset = (curPage - 1) * itemsPerPage + 1;    var end = offset + itemsPerPage - 1;    if(items < end) {        end = items;    }    setValue("tdb-item-start", offset);    setValue("tdb-item-end", end);    setValue("tdb-total-items", items);    function enable(things) {        for(var i = 0; i < things.length; i++) {            var thing = things[i];            self._getHandyNode(thing).style.display = "inline";            self._getHandyNode(thing + "-disabled").style.display = "none";        }    }    function disable(things) {        for(var i = 0; i < things.length; i++) {            var thing = things[i];            self._getHandyNode(thing + "-disabled").style.display = "inline";            self._getHandyNode(thing).style.display = "none";        }    }    var prevs = ["prev-page", "first-page"];    var nexts = ["next-page", "last-page"];    if (hasPrevPage) {        enable(prevs);    } else {        disable(prevs);    }    if (hasNextPage) {        enable(nexts);    } else {        disable(nexts);    }};
meta: 3455	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3455/0c673ddbc533f49346be123916465340bed5713f/tdb.js/buggy/xmantissa/static/js/tdb.js