Mercurial > wiki
changeset 3:ac7e15dcee69
Activate edits on mousedown instead of click to prevent default selection behavior.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 01 Feb 2009 12:53:25 -0800 |
parents | 1d3d91674bbe |
children | 01313b55ed09 |
files | wiki.js |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/wiki.js Sun Feb 01 12:51:45 2009 -0800 +++ b/wiki.js Sun Feb 01 12:53:25 2009 -0800 @@ -2,6 +2,8 @@ if (!aEvt.shiftKey) return; + aEvt.preventDefault(); + var item = this; var newItem = $('<textarea class="wikiedit"></textarea>'); $(newItem).attr("value", $(item).html()); @@ -15,7 +17,7 @@ function() { var html = $(newItem).attr("value"); $(item).html(html); - $(item).click(makeEditable); + $(item).mousedown(makeEditable); $(newItem).replaceWith(item); }); @@ -27,7 +29,7 @@ } function onLoad() { - $(".wiki").click(makeEditable); + $(".wiki").mousedown(makeEditable); } $(window).ready(onLoad);