Sha256: f500d0d38389dca5752e403cab099663e3d479d7382bedf326032acb3d91e0f3
Contents?: true
Size: 1.11 KB
Versions: 20
Compression:
Stored size: 1.11 KB
Contents
var PickyAddination = function(view, results) { // Calculate the addination range. // var calculateRange = function(data, correction) { var correction = correction || 0; var numberOfResults = 20; // Make parametrizable. var offset = data.offset + numberOfResults + correction; var end = offset + numberOfResults; var total = data.total; if (total < end) { end = total; } return { offset:offset, start:(offset+1), end:end }; }; // Remove the addination. // var remove = function() { results.find('.addination').remove(); }; this.remove = remove; // Renders the addination; // var render = function(data) { var total = data.total; var range = calculateRange(data); if (range.offset < total) { var result = $("<div class='addination current'>" + t('results.addination.more') + "<div class='tothetop'><a href='javascript:$.scrollTo(0,{ duration: 500});'>↑</a></div></div>"); result.bind('click', { offset: range.offset }, view.addinationClicked); return result; } else { return ''; } }; this.render = render; };
Version data entries
20 entries across 20 versions & 1 rubygems