You can use the type
of the event to unselect them, and you call an intermediate function that routing to the one you want.
More or less like this:
<a class = "alinhar1" href="#" ondblclick="clickHandler(event)" onClick="clickHandler(event)">'
and then the function:
function clickHandler(e){
if (e.type == 'dblclick') list.oneDblClick(e);
else if (e.type == 'click') list.oneClick(e);
}
I'm not sure that browsers support dblclick
but the modern ones support all I think.
Edit:
I noticed now that both events are fired in Chrome. Here's a solution to this that waits half a second to make sure what the event is:
var list = {
oneClick: function (e) {
alert('um clique do tipo: ' + e.type);
},
oneDblClick: function (e) {
alert('dois clique do tipo: ' + e.type);
},
timeout: null
};
function clickHandler(e) {
(function () {
var type = e.type;
var evt = e;
var verificador = function () {
list.timeout = null;
if (type == 'dblclick') list.oneDblClick(evt);
else if (type == 'click') list.oneClick(evt);
}
if (list.timeout) clearTimeout(list.timeout)
list.timeout = setTimeout(verificador, 500);
})();
}
jsFiddle: link