mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Favor FlowRouter.url over Meteor.absoluteUrl
It hides the leading slash treatment as an hidden implementation detail.
This commit is contained in:
parent
9ef8ebaf09
commit
701262a439
3 changed files with 17 additions and 34 deletions
|
|
@ -5,24 +5,3 @@ allowIsBoardAdmin = function(userId, board) {
|
|||
allowIsBoardMember = function(userId, board) {
|
||||
return board && board.hasMember(userId);
|
||||
};
|
||||
|
||||
// todo XXX not really server-specific,
|
||||
// so move it to a common (client+server) lib?
|
||||
Utils = {
|
||||
/**
|
||||
* If text starts with a / will remove it.
|
||||
* @param text
|
||||
*/
|
||||
stripLeadingSlash(text) {
|
||||
// we need an actual text string
|
||||
if (!text) {
|
||||
return text;
|
||||
}
|
||||
// if starting with slash
|
||||
if (text[0] === '/') {
|
||||
return text.slice(1);
|
||||
}
|
||||
// otherwise leave untouched
|
||||
return text;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue