Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
WIP: infinite scroll for glossary table
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Sep 3, 2015
1 parent dfde467 commit 911d722
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -281,6 +281,7 @@ var GlossaryDataTable = React.createClass({
},

_rowGetter: function(rowIndex) {
console.info('rowGetter', rowIndex);
var self = this,
row = self.props.glossaryResId[rowIndex];
if(row === null) {
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/main/web/lib/stores/GlossaryStore.js
Expand Up @@ -161,6 +161,8 @@ function processGlossaryList(serverResponse) {
startIndex +=1;
}

console.info('start', page, startIndex, _state['glossaryResId']);

_.forOwn(serverResponse.glossaryEntries, function(entry) {
var srcTerm =
GlossaryHelper.getTermByLocale(entry.glossaryTerms, entry.srcLang);
Expand All @@ -183,6 +185,8 @@ function processGlossaryList(serverResponse) {
_state['glossaryResId'].splice(startIndex, 1, [entry.resId]);
startIndex+=1;
});

console.info('end', startIndex, _state['glossaryResId']);
_state['original_glossary'] = _.cloneDeep(_state['glossary']);

return _state;
Expand Down Expand Up @@ -288,6 +292,7 @@ var GlossaryStore = assign({}, EventEmitter.prototype, {
case GlossaryActionTypes.TRANS_LOCALE_SELECTED:
console.log('translation locale from %s -> %s', _state['selectedTransLocale'], action.data);
_state['selectedTransLocale'] = action.data;
_state['page'] = 1;
loadGlossaryByLocale()
.then(processGlossaryList)
.then(function (newState) {
Expand Down

0 comments on commit 911d722

Please sign in to comment.