cblgh / cerca

lean forum software
Other
127 stars 18 forks source link

#32 Use ctrl-enter or meta-enter to submit form when on a textarea #44

Open milofultz opened 11 months ago

milofultz commented 11 months ago

This handles issue #32. This adds an event listener on the new-thread and the thread pages. Essentially what happens is, given they are on one of these two threads,

For each `textarea` element that is a child of a `form` element,
    If the user presses either `meta` or `ctrl` and presses the `enter` key while that former key is still down,
        Execute the `submit` method of the parent `form` element.

I used ctrl and meta to handle the major OS's (assuming Linux's main command key is one of those two).

Comments

I'm not precious about PR's. If you want to modify it, merge it, decline it, whatever, go for it. Thanks!