diff --git a/demos/calendar/js/calendar.js b/demos/calendar/js/calendar.js index 9a7b330d..5f2c01cb 100644 --- a/demos/calendar/js/calendar.js +++ b/demos/calendar/js/calendar.js @@ -202,6 +202,6 @@ Ox.load('UI', {debug: true, hideScreen: true, showScreen: true, theme: 'modern'} height: window.innerHeight, width: window.innerWidth, zoom: 4 - }).appendTo(Ox.UI.$body); + }).appendTo(Ox.UI.$body).gainFocus(); }); \ No newline at end of file diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js index ed5aec09..5b638d63 100644 --- a/source/Ox.UI/js/Calendar/Ox.Calendar.js +++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js @@ -583,10 +583,10 @@ Ox.Calendar = function(options, self) { } function getEventElement(event, zoom) { - var left = getPosition(event.start, zoom), + var left = Math.max(getPosition(event.start, zoom), -10000), paddingLeft = (event.type && left < 0 ? -left : 0), - width = Math.max(getPosition(event.end, zoom) - left, 1) - paddingLeft; - //textLeft = (left < 0 ? -left : 0); + width = Ox.limit(getPosition(event.end, zoom) - left, 1, 20000) - paddingLeft; + //Ox.print('LEFT', left, 'WIDTH', width) return new Ox.Element() .addClass('OxEvent' + (event.type ? ' Ox' + Ox.toTitleCase(event.type) : '' ) + @@ -601,20 +601,6 @@ Ox.Calendar = function(options, self) { id: event.id }) .html(' ' + event.name + ' ') - /* - .append( - $('