Jump to content

InputfieldSimpleMDE


Macrura
 Share

Recommended Posts

1 hour ago, tpr said:

Another fix is to append a script tag and call an init function. That would be more reliable imo.

I'm not sure how that would make it more reliable, since that's not one of the issues we were having to start with—and this way of handling the JS cuts down on complexity/errors that adding another included script file could introduce.

Link to comment
Share on other sites

The theory is to call the init fx after the field is rendered, no matter if its Ajax loaded or inside a tab, etc. A script tag appended to a field would run when the field Dom is ready. I haven't tested this in this particular case so it may fail somewhere, but in another module I made (not public) I went on this way and it solved all the timing/loading issues I had.

  • Like 1
Link to comment
Share on other sites

thanks to the hard work of @ethfun, the module is now better than before, it will init on the fields that are closed by tab or accordion;
The latest version separates the plugin files so those are easy to update to the latest version by just copying them into the module, instead of having to edit the module assets.

@ethfun sorry about the confusion with the pull request etc, Friday was a bit hectic, and thanks again.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...

For any users out here of this module, who are using languages, can anyone test to see if the latest version initializes the textareas on the language tabs when switching between language tabs?

I had a github issue report that only the first visible language tab's instance was getting initialized, so added the language tabs switching event to the array of events that trigger the field to get instantiated, and this works on my local testing, but the person who reported the issue was not seeing it working..

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...