davidbauer / Instacurate

Turn your Twitter timeline into a personalised news site, in an instant. Fetches links from your timeline and displays them in a discovery friendly design.
http://www.instacurate.com
113 stars 29 forks source link

Problems with new searchform event listener #24

Closed davidbauer closed 11 years ago

davidbauer commented 11 years ago
backflip commented 11 years ago

I would add a submit listener to the form instead of a click listener to the button. Then it doesn't matter how the form is submitted (click or enter or whatever).

Old:

$("#searchform #user").keyup(function(event){
    if(event.keyCode == 13){
        $("#searchform button.linkinput").click();
    }
});

$('.linkinput').click (function(e) {
    e.preventDefault();
    // do stuff
});

New:

$("#searchform").on('submit', function(event) {
    event.preventDefault();
    // do stuff
});

The button would have to be changed to type="submit".

davidbauer commented 11 years ago

@dergraf, what do you think? what was your reasoning behind chaning the listener?

dergraf commented 11 years ago

the problems you mentioned are quite strange... but can definitely reproduce them. will it work with the submit-listener?