Harden JS

Issue #7 resolved
Björn Jacob created an issue

We've tried to change the input[type=submit] inside the template to a button[type=submit]. Unfortunately, the JS is "hard coded" and is looking for the input[type=submit].

Maybe it would be a better idea to listen to a special class or something like that. Furthermore, the JS should use a variable instead of writting 7 times "input[type=submit]".

What do you think :)

P.S. Sorry for all the tickets. Please stop me if I'm giving yozu rocking guys a hard time.

Comments (4)

  1. Björn Jacob reporter

    Here is my proposal: http://pastebin.com/MWtcyn3Y

    What did I do:

    • clean up code, removed duplicate selectors (DRY - don't repeat yourself :) )
    • repaired spinner - use fontawesome classes, should be configurable I know ;)
    • usage of generic submit class -> that way one can have a button or anything else for submit (as long as a specific class is set to subscribe button)

    Because of the last point

    plugin.tx_pxanewslettersubscription.settings.form.button.subscribe.class = btn btn-submit

    is needed.

    Hope that helps a little bit ;)

  2. Björn Jacob reporter

    This is still open. We will provide a PR on github. This issue can be closed over here.

  3. Log in to comment