jakiestfu / Medium.js

A tiny JavaScript library for making contenteditable beautiful (Like Medium's editor)
http://jakiestfu.github.io/Medium.js/
4.39k stars 404 forks source link

Double click to edit #185

Open el-quick opened 8 years ago

el-quick commented 8 years ago

Please add a custom option to enable edition on click or doble click.

jakiestfu commented 8 years ago

Couldn't you attach your own double click handler that will instantiate Medium and focus in the field? This seems like auxiliary logic that doesn't belong in Medium.

robertleeplummerjr commented 8 years ago

Maybe this will work:

el.addEventListener('dblclick', function elDblClick() {
  el.removeEventListener('dblclick', elDblClick);
  new Medium({ element: el });
});