mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
add "currentList" to ReactiveCache
This commit is contained in:
parent
1b3135a79f
commit
c6ee58ef88
2 changed files with 14 additions and 6 deletions
|
|
@ -13,12 +13,8 @@ Blaze.registerHelper('currentCard', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Blaze.registerHelper('currentList', () => {
|
Blaze.registerHelper('currentList', () => {
|
||||||
const listId = Session.get('currentList');
|
const ret = Utils.getCurrentList();
|
||||||
if (listId) {
|
return ret;
|
||||||
return Lists.findOne(listId);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Blaze.registerHelper('getUser', userId => Users.findOne(userId));
|
Blaze.registerHelper('getUser', userId => Users.findOne(userId));
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ Utils = {
|
||||||
const ret = Session.get('popupCardId');
|
const ret = Session.get('popupCardId');
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
getCurrentListId() {
|
||||||
|
const ret = Session.get('currentList');
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
/** returns the current board
|
/** returns the current board
|
||||||
* <li> returns the current board or the board of the popup card if set
|
* <li> returns the current board or the board of the popup card if set
|
||||||
*/
|
*/
|
||||||
|
|
@ -46,6 +50,14 @@ Utils = {
|
||||||
const ret = ReactiveCache.getCard(cardId);
|
const ret = ReactiveCache.getCard(cardId);
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
getCurrentList() {
|
||||||
|
const listId = this.getCurrentListId();
|
||||||
|
let ret = null;
|
||||||
|
if (listId) {
|
||||||
|
ret = ReactiveCache.getList(listId);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
getPopupCard() {
|
getPopupCard() {
|
||||||
const cardId = Utils.getPopupCardId();
|
const cardId = Utils.getPopupCardId();
|
||||||
const ret = ReactiveCache.getCard(cardId);
|
const ret = ReactiveCache.getCard(cardId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue