1.1.0 • Published 9 years ago

monitor-text-selection v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

monitor-select

emit events for selection and deselection of text for a given element.

Installation

Install with component(1):

$ component install bmcmahen/monitor-text-selection

Example

var el = document.querySelector('#text');
var monitor = require('monitor-text-selection')(el);
monitor.on('selected', function(e, el){
  console.log('selected');
});

monitor.on('deselected', function(e, el){
  console.log('deselected');
});

// unbind 
monitor.unbind();

License

MIT