-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix per-tiddler previews #7900
Fix per-tiddler previews #7900
Conversation
Needed in case this is targeted in CSS; DOM structure should not be changed.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Do it once, do it right.
If it does revert #7747 it also re-introduces the problem for issue #7745 with the codemirror 6 plugin. So I think we should not use the qualify-macro to create a state name, IMO we should use the draft-tiddler-title to create a unique state tiddler. Since the button and the editor preview should know this title, it should be possible to toggle the preview without redrawing the editor section. @BurningTreeC ... Please test this preview https://tiddlywiki5-c5ljtb9p0-jermolene.vercel.app/ with the CM-6 plugin. Is the #7745 problem back with this preview version? @BurningTreeC ... Does TW v5.3.2 work as expected with the CM6 plugin. If I do test the UI with the browser "paint flashing" active, it seems to redraw the editor |
If I put a Since the class on the DIV surrounding the editor changes when the preview is toggled, I think it might not be possible to prevent the child redraw. Maybe @Jermolene solved the problem by setting the focus back to the editor at the end of the button code? That is still in there, so it might work. I guess we'll have to wait for feedback from @BurningTreeC. |
* Initial commit * Put SVG back into a span Needed in case this is targeted in CSS; DOM structure should not be changed. * Fix the fix Do it once, do it right.
This is a fix for #7893.
Basically, it reverts the parts of #7747 that use a function in the EditTemplate in favor of setting the variable
editPreviewStateTiddler
which is also referred to in the preview button code. Otherwise, the qualify macro yields different state tiddlers and previews cannot be activated.In one fell swoop, I also streamlined the preview button code to make use of inline filters instead of multiple RevealWidgets. This reduces it to three lines. It could be rolled back, of course, if we want to be conservative there.