/* flux-reactions v0.0.2 (26-3-2015) * https://github.com/arqex/flux-reactions.git * By arqex * License: MIT */ !function(t,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():t.Reactions=n()}(this,function(){"use strict";var t=window.document,n=function(t,n,e){t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent?t.attachEvent("on"+n,e):t["on"+n]=e},e=function(t,n,e){t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent?t.detachEvent("on"+n,e):delete t["on"+n]},i=function(t,n,e){var i,o=t;if(document.createEvent?(i=document.createEvent("HTMLEvents"),i.initEvent(n,!0,!0)):document.createEventObject&&(i=document.createEventObject(),i.eventType=n),i.detail=e,o.dispatchEvent){o.dispatchEvent(i)}else o.fireEvent&&htmlEvents["on"+n]?o.fireEvent("on"+n,i):o[n]?o[n]():o["on"+n]&&o["on"+n]();return i},o={on:function(e,i){return n(t,e,i),this},once:function(i,o){var r=function c(){o.apply(null,arguments),e(t,i,c)};return n(t,i,r),this},off:function(n,i){return e(t,n,i),this},trigger:function(n,e){return i(t,n,e),this},mixin:{trigger:function(t,n){return i(this.getDOMNode(),t,n)},thenTrigger:function(t,n){return this.trigger.bind(this,t,n)},listenTo:function(t,e){n(this.getDOMNode(),t,e)},componentDidMount:function(){if(this.onEvents){{var t,n;this.getDOMNode()}for(t in this.onEvents)n=this.onEvents[t],"function"!=typeof n&&(n=this[n]),this.listenTo(t,n.bind(this))}}}};return o});