Closed fagga closed 13 years ago
You'll have to bind 'c' within the ajax callback that updates the comment links for it to work - after the comment link has finished it's animation (probably as a finish callback on the animation). Also, since it will be updated frequently you have to make sure you are unbinding the previous click action before each updated binding.
The problem seems to be calling the .click() event on tags. It gets called but doesn’t do anything. Searching for it gave a possible explanation but I didn’t understand it.
In the reddit enhancement suite initMouseEvent and dispatchEvent are used, but those didn’t do anything either.
Maybe this is intentional to prevent popups.
Ah, well you could do a simple window.open(url)
Yes, but that’s where the popup blockers pop up. I thought there could be a way to avoid them because it’s not really a popup as it opens via key stroke. But if there is no other way, it’s probably better than nothing.
Yeah, we can't defeat popup blockers, and we shouldn't be trying :) Most browsers will at least give the option to the user to let the website open the window or not.
Well, the popup blocker is oversensitive here, at least in Firefox. It shouldn’t matter how the user indicates that he wants to open the comments, via mouse or keyboard.
Anyway, a used window.open() now and it works somehow.
I added support for hjkl keybindings like in Vim.
I also tried to bind 'c' to open the comments page but couldn’t get it to work with jQuery’s .click(). Maybe you know how this could be done?