|
|
|
|
@ -74,23 +74,6 @@ export class RoomTypesCommon { |
|
|
|
|
return FlowRouter.path(this.roomTypes[roomType].route.name, routeData); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
openRouteLink(roomType, subData, queryParams) { |
|
|
|
|
if (!this.roomTypes[roomType]) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let routeData = {}; |
|
|
|
|
if (this.roomTypes[roomType] && this.roomTypes[roomType].route && this.roomTypes[roomType].route.link) { |
|
|
|
|
routeData = this.roomTypes[roomType].route.link(subData); |
|
|
|
|
} else if (subData && subData.name) { |
|
|
|
|
routeData = { |
|
|
|
|
name: subData.name, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return FlowRouter.go(this.roomTypes[roomType].route.name, routeData, queryParams); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param {string} roomType room type (e.g.: c (for channels), d (for direct channels)) |
|
|
|
|
* @param {RoomTypeConfig} roomConfig room's type configuration |
|
|
|
|
@ -98,4 +81,12 @@ export class RoomTypesCommon { |
|
|
|
|
getConfig(roomType) { |
|
|
|
|
return this.roomTypes[roomType]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getURL(...args) { |
|
|
|
|
const path = this.getRouteLink(...args); |
|
|
|
|
if (!path) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return Meteor.absoluteUrl(path.replace(/^\//, '')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|