views:

23

answers:

2

hey guys, i wonder if this is the best solution?

    $('.folder a').click(function(e) {
  e.preventDefault();
});

$('.folder a').dblclick(function(e) {
    window.location.replace($(this).attr("href"));
});

it's working! would you do it in a different manner?

+1  A: 

What you're doing works and is fine technically.

The issue is with the UI. Double-clicking on a hyperlink is not intuitive behaviour. Particularly when disabling the click behaviour. I would suggest a more intuitive UI.

cletus
Looks like he's working with a directory-like view, so you would want to double-click a folder to open it.
virstulte
A: 

Nope that's perfect.

Marko