mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
🎨 Koenig - Focus URL input after creating embed card
refs https://github.com/TryGhost/Ghost/issues/9623
This commit is contained in:
parent
2dc916299b
commit
49d2ed2fb4
@ -41,6 +41,7 @@ export default Component.extend({
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
this._loadPayloadScript();
|
||||
this._focusInput();
|
||||
},
|
||||
|
||||
actions: {
|
||||
@ -118,6 +119,14 @@ export default Component.extend({
|
||||
}
|
||||
}),
|
||||
|
||||
_focusInput() {
|
||||
let urlInput = this.element.querySelector('[name="url"]');
|
||||
|
||||
if (urlInput) {
|
||||
urlInput.focus();
|
||||
}
|
||||
},
|
||||
|
||||
// some oembeds will have a script tag but it won't automatically run
|
||||
// due to the way Ember renders the card components. Grab the script
|
||||
// element and push a new one to force the browser to download+run it
|
||||
|
@ -47,6 +47,7 @@
|
||||
<input
|
||||
type="text"
|
||||
value={{payload.url}}
|
||||
name="url"
|
||||
placeholder="Paste URL to add embedded content..."
|
||||
class="miw-100 pa2 ba br2 b--lightgrey-d2 f7 form-text lh-title tracked-2 h10"
|
||||
oninput={{action "updateUrl"}}
|
||||
|
Loading…
Reference in New Issue
Block a user