OHIF-157 Use OHIF.utils.absoluteUrl which removes the leading “/” from path before calling Meteor.absoluteUrl
This commit is contained in:
1 parent
583147c542
commit
82876ddbe7
8 files changed
+23
-13
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Session } from 'meteor/session';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
/**
|
||||
* Global Blaze UI helpers to work with Blaze
|
||||
@@ -9,7 +9,7 @@ import { ReactiveVar } from 'meteor/reactive-var';
|
||||
|
||||
// Return the absolute url
|
||||
Template.registerHelper('absoluteUrl', path => {
|
||||
return Meteor.absoluteUrl(path);
|
||||
return OHIF.utils.absoluteUrl(path);
|
||||
});
|
||||
|
||||
// Return the current template instance
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
// Return an absolute URL with the given path by supporting the leading "/"
|
||||
OHIF.utils.absoluteUrl = function(path) {
|
||||
path = path.replace(/^\//, '');
|
||||
return Meteor.absoluteUrl(path);
|
||||
};
|
||||
|
||||
// Return the array sorting function for its object's properties
|
||||
OHIF.utils.sortBy = function() {
|
||||
var fields = [].slice.call(arguments),
|
||||
|
||||
Reference in new issue
Block a user