evancofer / reddigest-scalafied

A rewrite and revamp of reddigest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix active button selection during color change on login/register page.

evancofer opened this issue · comments

Note that if the username & password fields are non-empty for login and login button is green, then register will also be green, despite its respective username & password fields being empty.. The same occurs if the fields for register are filled: login will be green. We want them to only become active when their specific fields have been filled.

SEE: #15

Note that we are doing all DOM styling and effects (such as this) in pure javascript/jquery, NOT in Scala.js. For things such as this we are doing lightweight scripting and as such we need a lightweight scripting language such as javascript. For this, scala.js requires too much setup and is not well enough supported/documented/implemented to guarantee ease of use, and would only serve to create a layer of obfuscation. Therefore, all functions for these effects should go into the public/javascripts/scripts.js file. Note that all native (i.e. non scala.js) javascript functions must be named: js_name to prevent any possibility of conflict with the separate body of scala.js code.

The reason this is occurring is because on both of the forms the inputs have the same id (e.g. "username"). I'm surprised that this doesn't cause other problems, since ids are supposed to be unique.

The id is set by plays form system, and unfortunately I think they're the easiest way of passing forms to the server. They have the class of username and password however. And now that they're all contained in a user-action-form-container, DOM traversal w/ jquery to them should be feasible.

Fixed. Can't pass strings into the twirl template form helpers without them mangling for some reason.