fix some scrollbar scale bugs

This commit is contained in:
rolux 2011-05-26 20:49:48 +02:00
parent 385aac008c
commit 457e175455
3 changed files with 5 additions and 5 deletions

View file

@ -120,6 +120,7 @@ Ox.load('UI', {debug: true, hideScreen: true, showScreen: true, theme: 'modern'}
{name: 'Andy Warhol', start: '1928-08-06', end: '1987-02-22', type: 'person'},
{name: 'Félix Guattari', start: '1930-04-30', end: '1992-08-29', type: 'person'},
{name: 'Guy Debord', start: '1931-12-28', end: '1994-11-30', type: 'person'},
{name: 'Saddam Hussein', start: '1937-04-28', end: '2006-12-30', type: 'person'},
{name: 'John Lennon', start: '1940-10-09', end: '1980-12-08', type: 'person'},
{name: 'Jimi Hendrix', start: '1942-11-27', end: '1970-09-18', type: 'person'},
{name: 'Edie Sedgwick', start: '1943-04-20', end: '1971-11-16', type: 'person'},

View file

@ -178,14 +178,11 @@ Ox.Calendar = function(options, self) {
id: 'month',
seconds: 365.2425 / 12 * 86400,
date: function(i) {
///*
var date = new Date();
date.setUTCFullYear(Math.floor(i / 12) + 1970);
date.setUTCMonth(Ox.mod(i, 12));
date.setUTCDate(0); // fixme: WTF??
return date;
//*/
//return new Date(Date.UTC(Math.floor(i / 12) + 1970, Ox.mod(i, 12), 1));
},
name: function(i) {
return Ox.SHORT_MONTHS[Ox.mod(i, 12)] + ' ' + Math.floor(i / 12 + 1970)
@ -451,7 +448,7 @@ Ox.Calendar = function(options, self) {
marginLeft: (e.clientX - self.drag.x) + 'px'
});
self.$scrollbar.css({
marginLeft: Math.round((e.clientX - self.drag.x) / 16) + 'px'
marginLeft: Math.round((e.clientX - self.drag.x) / getScrollbarFactor()) + 'px'
});
//*/
/*
@ -515,7 +512,7 @@ Ox.Calendar = function(options, self) {
function dragafterScrollbar(e) {
self.options.date = new Date(
+self.options.date + (self.drag.x - e.clientX) * getSecondsPerPixel() * 1000 * 16
+self.options.date + (self.drag.x - e.clientX) * getSecondsPerPixel() * 1000 * getScrollbarFactor()
);
// fixme: duplicated
self.$content.css({

View file

@ -1136,6 +1136,8 @@ Ox.PATH = Array.prototype.slice.apply(
})[0].src.replace('Ox.js', '');
//@ Ox.PREFIXES <[str]> <code>['K', 'M', 'G', 'T', 'P']</code>
Ox.PREFIXES = ['K', 'M', 'G', 'T', 'P'];
//@ Ox.SEASONS <[str]> Names of the seasons of the year
Ox.SEASONS = ['Winter', 'Spring', 'Summer', 'Fall'];
//@ Ox.SYMBOLS <obj> Unicode characters for symbols
Ox.SYMBOLS = {
DOLLAR: '\u0024',