Fix Top Menu Url
This fixes it so that if it provides a url with https:// then it will use it instead of building from the base url and then adding a extra url. Bug: Issue 9772 Change-Id: I984204249425ba44c432794f804e0357cd5a2cfb
This commit is contained in:
@@ -229,7 +229,7 @@
|
|||||||
if (typeof link.url === 'undefined') {
|
if (typeof link.url === 'undefined') {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (link.target) {
|
if (link.target || !link.url.startsWith('/')) {
|
||||||
return link.url;
|
return link.url;
|
||||||
}
|
}
|
||||||
return this._computeRelativeURL(link.url);
|
return this._computeRelativeURL(link.url);
|
||||||
|
@@ -72,6 +72,12 @@ limitations under the License.
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('link URLs', () => {
|
test('link URLs', () => {
|
||||||
|
assert.equal(
|
||||||
|
element._computeLinkURL({url: 'http://example.com/test'}),
|
||||||
|
'http://example.com/test');
|
||||||
|
assert.equal(
|
||||||
|
element._computeLinkURL({url: 'https://example.com/test'}),
|
||||||
|
'https://example.com/test');
|
||||||
assert.equal(
|
assert.equal(
|
||||||
element._computeLinkURL({url: '/test'}),
|
element._computeLinkURL({url: '/test'}),
|
||||||
'//' + window.location.host + '/test');
|
'//' + window.location.host + '/test');
|
||||||
|
Reference in New Issue
Block a user