mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05: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
1 changed files with 7 additions and 5 deletions
|
@ -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…
Add table
Reference in a new issue