diff --git a/dist/cron-ui.min.js b/dist/cron-ui.min.js
index 9ea5ca9..f9346f6 100644
--- a/dist/cron-ui.min.js
+++ b/dist/cron-ui.min.js
@@ -1,2 +1 @@
-// Version: 0.1
-function CronUI(container,opts){if(container instanceof HTMLElement){this.el=container}else if(typeof container==='string'){this.el=document.querySelector(container)}else{throw "CronUI: container parameter in initialization must be an html element or a string selector."}this.options=opts?opts:{};this.render();if(typeof this.options.initial!=='string'){this.options.initial='* * * * *'}this.setCronString(this.options.initial);this.currentValue=this.options.initial}CronUI.prototype.render=function(){var el=this.el;var str_opt_mih="";for(var i=0;i<60;i+=1){var j=(i<10)?"0":"";str_opt_mih+="\n"}var str_opt_hid="";for(var i=0;i<24;i+=1){var j=(i<10)?"0":"";str_opt_hid+="\n"}var str_opt_dom="";for(var i=1;i<32;i+=1){if(i==1||i==21||i==31){var suffix="st"}else if(i==2||i==22){var suffix="nd"}else if(i==3||i==23){var suffix="rd"}else{var suffix="th"}str_opt_dom+="\n"}var str_opt_month="";var months=["January","February","March","April","May","June","July","August","September","October","November","December"];for(var i=0;i"+months[i]+"\n"}var str_opt_dow="";var days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];for(var i=0;i"+days[i]+"\n"}var str_opt_period="";var periods=["minute","hour","day","week","month","year"];for(var i=0;i"+periods[i]+"\n"}var blocks={};el.insertAdjacentHTML('beforeend',"");var periodEl=el.querySelector('.cron-period select');periodEl.addEventListener("change",this.periodChanged.bind(this));periodEl.addEventListener("change",this.changeEvent.bind(this));el.insertAdjacentHTML('beforeend'," on the ");blocks["dom"]=el.querySelector('.cron-block-dom');el.insertAdjacentHTML('beforeend'," of ");blocks["month"]=el.querySelector('.cron-block-month');el.insertAdjacentHTML('beforeend'," at minutes past the hour ");blocks["mins"]=el.querySelector('.cron-block-mins');el.insertAdjacentHTML('beforeend'," on ");blocks["dow"]=el.querySelector('.cron-block-dow');el.insertAdjacentHTML('beforeend'," at :");blocks["time"]=el.querySelector('.cron-block-time');for(var blockName in blocks){for(var selectEl of blocks[blockName].querySelectorAll('select')){selectEl.addEventListener("change",this.changeEvent.bind(this))}}this.blocks=blocks};CronUI.prototype.periodChanged=function(){var blocks=this.blocks;var cronPeriodEl=this.el.querySelector('.cron-period select');var period=cronPeriodEl.options[cronPeriodEl.selectedIndex].value;for(var blockName in blocks){blocks[blockName].style.display='none'}if(CronUI.displayMatrix.hasOwnProperty(period)){var b=CronUI.displayMatrix[period];for(var i=0;i=minval[i]){continue}return undefined}for(var type in CronUI.cronTypes){if(CronUI.cronTypes[type].test(cronString)){return type}}return undefined};
\ No newline at end of file
+function CronUI(e,t){if(e instanceof HTMLElement)this.el=e;else{if("string"!=typeof e)throw"CronUI: container parameter in initialization must be an html element or a string selector.";this.el=document.querySelector(e)}this.options=t?t:{},this.render(),"string"!=typeof this.options.initial&&(this.options.initial="* * * * *"),this.setCronString(this.options.initial),this.currentValue=this.options.initial}CronUI.prototype.render=function(){for(var e=this.el,t="",r=0;60>r;r++){var n=10>r?"0":"";t+="\n"}for(var o="",r=0;24>r;r++){var n=10>r?"0":"";o+="\n"}for(var i="",r=1;32>r;r++){if(1==r||21==r||31==r)var s="st";else if(2==r||22==r)var s="nd";else if(3==r||23==r)var s="rd";else var s="th";i+="\n"}for(var c="",a=["January","February","March","April","May","June","July","August","September","October","November","December"],r=0;r"+a[r]+"\n";for(var l="",u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=0;r"+u[r]+"\n";for(var d="",h=["minute","hour","day","week","month","year"],r=0;r"+h[r]+"\n";var m={};e.insertAdjacentHTML("beforeend","");var p=e.querySelector(".cron-period select");p.addEventListener("change",this.periodChanged.bind(this)),p.addEventListener("change",this.changeEvent.bind(this)),e.insertAdjacentHTML("beforeend"," on the "),m.dom=e.querySelector(".cron-block-dom"),e.insertAdjacentHTML("beforeend"," of "),m.month=e.querySelector(".cron-block-month"),e.insertAdjacentHTML("beforeend"," at minutes past the hour "),m.mins=e.querySelector(".cron-block-mins"),e.insertAdjacentHTML("beforeend"," on "),m.dow=e.querySelector(".cron-block-dow"),e.insertAdjacentHTML("beforeend"," at :"),m.time=e.querySelector(".cron-block-time");for(var y in m)[].forEach.call(m[y].querySelectorAll("select"),function(e){e.addEventListener("change",this.changeEvent.bind(this))}.bind(this));this.blocks=m},CronUI.prototype.periodChanged=function(){var e=this.blocks,t=this.el.querySelector(".cron-period select"),r=t.options[t.selectedIndex].value;for(var n in e)e[n].style.display="none";if(CronUI.displayMatrix.hasOwnProperty(r))for(var o=CronUI.displayMatrix[r],i=0;i=n[i]))return}for(var c in CronUI.cronTypes)if(CronUI.cronTypes[c].test(e))return c}};
\ No newline at end of file
diff --git a/lib/cron-ui.js b/lib/cron-ui.js
index 4e51e81..7eec5ee 100644
--- a/lib/cron-ui.js
+++ b/lib/cron-ui.js
@@ -128,9 +128,9 @@ CronUI.prototype.render = function() {
// Atttach the change event to all selectors
for (var blockName in blocks) {
- for (var selectEl of blocks[blockName].querySelectorAll('select')) {
+ [].forEach.call(blocks[blockName].querySelectorAll('select'), function(selectEl) {
selectEl.addEventListener("change", this.changeEvent.bind(this));
- }
+ }.bind(this));
}
// Save a reference to blocks