5 * wysihtml5.dom.delegate(document.body, "a", "click", function() {
11 wysihtml5.dom.delegate = function(container, selector, eventName, handler) {
12 return wysihtml5.dom.observe(container, eventName, function(event) {
13 var target = event.target,
14 match = wysihtml5.lang.array(container.querySelectorAll(selector));
16 while (target && target !== container) {
17 if (match.contains(target)) {
18 handler.call(target, event);
21 target = target.parentNode;