Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post code injection loading state broken #9249

Closed
JohnONolan opened this issue Nov 16, 2017 · 3 comments · Fixed by TryGhost/Admin#935
Closed

Post code injection loading state broken #9249

JohnONolan opened this issue Nov 16, 2017 · 3 comments · Fixed by TryGhost/Admin#935
Assignees
Labels
affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly

Comments

@JohnONolan
Copy link
Member

This happens to me 9 out of 10x when I access code injection in the PSM. Looks like this for 3-5seconds, then loads the inputs

Ghost 1.17.1
Chrome 62.0.3202.94

image

@kirrg001 kirrg001 added affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly labels Nov 16, 2017
@kevinansfield
Copy link
Contributor

@JohnONolan to confirm, does this only happen the first time you open the code injection panel?

CodeMirror is loaded asynchronously which is why it will take a while for the input fields to appear the first time after loading the admin panel, subsequent opens should be instant until the admin panel is refreshed.

We should be able to:
a) have textareas visible and usable while CodeMirror is loading in the background
b) show a loading spinner in place of the inputs (if a isn't possible for some reason)

@kevinansfield
Copy link
Contributor

This also ties in with a different issue - we currently have two sets of CodeMirror code in Ghost-Admin 😖. One is baked in as part of the SimpleMDE code and the other is separated out for the code injection screen/PSM inputs.

It's been on my radar for a while to either adapt our SimpleMDE fork so that we can load our already separated CodeMirror code (thus reducing initial admin load time) or getting rid of the separated CodeMirror build and use the baked-in version for the code injection inputs (keeping higher initial load time but reducing build artefacts and removing async loading times as seen in this issue).

@jloh
Copy link
Member

jloh commented Nov 16, 2017

I can confirm the behaviour:

  1. Load Ghost and select any post (or create a new one)
  2. Go into post settings -> Code Injection
  3. See code injection boxes don't exist like image above then they pop into existance
  4. Load any other post (without reloading Ghost Admin) and boxes appear instantly

Running Ghost v1.17.2 on Ghost(Pro)

kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jan 2, 2018
closes TryGhost/Ghost#9249
- in `{{gh-cm-editor}}` display a standard textarea in place of the CodeMirror editor whilst CodeMirror assets are loading in the background, textarea will be upgraded to a CodeMirror editor when loading finishes
- update styles so that the switch from plain textarea to CodeMirror is not too jarring
kevinansfield added a commit to TryGhost/Admin that referenced this issue Jan 2, 2018
closes TryGhost/Ghost#9249
- in `{{gh-cm-editor}}` display a standard textarea in place of the CodeMirror editor whilst CodeMirror assets are loading in the background, textarea will be upgraded to a CodeMirror editor when loading finishes
- update styles so that the switch from plain textarea to CodeMirror is not too jarring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants