A friendly UI to let users to select dom elements.
Include dom-selector.js
and dom-selector.css
and start the selection by running:
domSelector.start(function(selectedElement) {
doStuffWithTheUserSelectedElement();
});
Works out of the box for IE>8 and recent browsers. It should eventually be easy enough to add support for IE8, just by loading either es5-shim or jQuery 1.x before the dom-selector script.
On IE8, we can't prevent existing events on an element to be triggered when it is selected, so some of the page original behaviour may be triggered while in selection mode. That's because IE8 doesn't support event capturing. However, dom-selector can and will stop the default behaviour (like following a link when clicking one) while in selection mode, so this will only be a problem on elements whose behaviour is handled by JS events.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.
- v0.1.0: MVP release
- Add screenshots to the README.
- Add integration tests
- Ensure IE8 compatibility with jQuery or es5-shim
- Add parameters:
- Cancel callback
- Selection callback (for any selection, not just the final submitted one)
- Bar element renderer
- CSS class names?
Copyright (c) 2014 Emmanuel Joubaud. Licensed under the MIT license.