diff --git a/core/client/components/gh-navitem-url-input.js b/core/client/components/gh-navitem-url-input.js index 589e07f06b..7cdb15ea04 100644 --- a/core/client/components/gh-navitem-url-input.js +++ b/core/client/components/gh-navitem-url-input.js @@ -20,7 +20,7 @@ var NavItemUrlInputComponent = Ember.TextField.extend({ }), isRelative: Ember.computed('value', function () { - return !validator.isURL(this.get('value')); + return !validator.isURL(this.get('value')) && this.get('value').indexOf('mailto:') !== 0; }), didInsertElement: function () { @@ -80,6 +80,7 @@ var NavItemUrlInputComponent = Ember.TextField.extend({ var url = this.get('value'), baseUrl = this.get('baseUrl'); + // if we have a relative url, create the absolute url to be displayed in the input if (this.get('isRelative')) { this.set('value', joinUrlParts(baseUrl, url)); } diff --git a/core/client/controllers/settings/navigation.js b/core/client/controllers/settings/navigation.js index ef798f83c5..907f3b80b9 100644 --- a/core/client/controllers/settings/navigation.js +++ b/core/client/controllers/settings/navigation.js @@ -132,7 +132,7 @@ NavigationController = Ember.Controller.extend({ if (url[url.length - 1] !== '/') { url += '/'; } - } else if (!validator.isURL(url) && url !== '' && url[0] !== '/') { + } else if (!validator.isURL(url) && url !== '' && url[0] !== '/' && url.indexOf('mailto:') !== 0) { url = '/' + url; } diff --git a/core/server/config/url.js b/core/server/config/url.js index fb85a7d78f..af33f108d2 100644 --- a/core/server/config/url.js +++ b/core/server/config/url.js @@ -170,7 +170,7 @@ function urlFor(context, data, absolute) { } // This url already has a protocol so is likely an external url to be returned - if (urlPath && urlPath.indexOf('://') !== -1) { + if (urlPath && (urlPath.indexOf('://') !== -1 || urlPath.indexOf('mailto:') === 0)) { return urlPath; }