mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Fix url field focus (#174)
Closes #7140 * Even if the url was blank, it was always appending a `/` at the end which would cause isBlank to return false. Added logic that if the url was blank, don’t try to then add the trailing slash.
This commit is contained in:
parent
8f5d91f0c2
commit
6b7591c2bd
@ -131,12 +131,14 @@ export default TextField.extend(InvokeActionMixin, {
|
||||
url = url.replace(baseUrlParts.pathname.slice(0, -1), '');
|
||||
}
|
||||
|
||||
if (!url.match(/^\//)) {
|
||||
url = `/${url}`;
|
||||
}
|
||||
if (url !== '') {
|
||||
if (!url.match(/^\//)) {
|
||||
url = `/${url}`;
|
||||
}
|
||||
|
||||
if (!url.match(/\/$/) && !url.match(/[\.#\?]/)) {
|
||||
url = `${url}/`;
|
||||
if (!url.match(/\/$/) && !url.match(/[\.#\?]/)) {
|
||||
url = `${url}/`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user