change sort algorithm for events stacking

This commit is contained in:
rolux 2011-05-27 14:20:54 +02:00
parent 453f226b18
commit 3d7607b78a
3 changed files with 14 additions and 4 deletions

View file

@ -132,6 +132,8 @@ Ox.load('UI', {debug: true, hideScreen: true, showScreen: true, theme: 'modern'}
{name: 'Kurt Gödel', start: '1906-04-28', end: '1978-01-14', type: 'person'},
{name: 'Grace Hopper', start: '1906-12-09', end: '1992-01-01', type: 'person'},
{name: 'Alan Turing', start: '1912-06-23', end: '1954-06-07', type: 'person'},
{name: 'Henri Langlois', start: '1914-11-13', end: '1977-01-13', type: 'person'},
{name: 'François Mitterrand', start: '1916-10-26', end: '1996-01-08', type: 'person'},
{name: 'John F. Kennedy', start: '1917-05-29', end: '1963-11-22', type: 'person'},
{name: 'Gilles Deleuze', start: '1925-01-18', end: '1995-11-04', type: 'person'},
{name: 'Pol Pot', start: '1925-05-19', end: '1998-04-15', type: 'person'},
@ -147,6 +149,7 @@ Ox.load('UI', {debug: true, hideScreen: true, showScreen: true, theme: 'modern'}
{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'},
{name: 'Jim Morrison', start: '1943-12-08', end: '1971-06-03', type: 'person'},
{name: 'Serge Daney', start: '1944-06-04', end: '1992-06-12', type: 'person'},
{name: 'Osama bin Laden', start: '1957-03-10', end: '2011-05-02', type: 'person'},
{name: 'Michael Jackson', start: '1958-08-29', end: '2009-06-25', type: 'person'},
{name: 'Lady Diana', start: '1961-07-01', end: '1997-08-31', type: 'person'},
@ -164,12 +167,13 @@ Ox.load('UI', {debug: true, hideScreen: true, showScreen: true, theme: 'modern'}
{name: 'East Germany', start: '1949-10-07', end: '1990-10-03', type: 'place'},
{name: 'Berlin Wall', start: '1961-08-13', end: '1989-11-09', type: 'place'},
{name: 'World Trade Center', start: '1973-04-04', end: '2001-09-11', type: 'place'},
{name: 'European Union', start: '1993-11-01', end: '', type: 'place'},
{name: 'Stone Age', start: '-10000', end: '-3000', type: 'other'},
{name: 'Bronze Age', start: '-3000', end: '-1000', type: 'other'},
{name: 'Iron Age', start: '-1000', end: '500', type: 'other'},
{name: 'Middle Ages', start: '500', end: '1350', type: 'other'},
{name: 'Middle Ages', start: '501', end: '1350', type: 'other'},
{name: 'Battle of Hastings', start: '1066-10-14', end: '1066-10-15', type: 'other'},
{name: 'Crusades', start: '1095', end: '1291', type: 'other'},
{name: 'Hundred Years\' War', start: '1337', end: '1453', type: 'other'},

View file

@ -169,8 +169,8 @@ Calendar
//background: -webkit-linear-gradient(top, rgba(255, 0, 64, 0.9), rgba(224, 0, 32, 0.9));
}
.OxCalendar .OxLine > .OxEvent.OxPerson {
//background: -moz-linear-gradient(top, rgba(255, 96, 0, 0.9), rgba(224, 80, 0, 0.9));
//background: -webkit-linear-gradient(top, rgba(255, 96, 0, 0.9), rgba(224, 80, 0, 0.9));
background: -moz-linear-gradient(top, rgba(255, 96, 0, 0.9), rgba(224, 80, 0, 0.9));
background: -webkit-linear-gradient(top, rgba(255, 96, 0, 0.9), rgba(224, 80, 0, 0.9));
}
.OxCalendar .OxLine > .OxEvent.OxSelected {
background: -moz-linear-gradient(top, rgba(128, 128, 255, 0.9), rgba(96, 96, 224, 0.9));

View file

@ -831,8 +831,14 @@ Ox.Calendar = function(options, self) {
return -1;
} else if (a.type != 'date' && b.type == 'date') {
return 1;
} else if (a.type == 'person' && b.type != 'person') {
return 1;
} else if (a.type != 'person' && b.type == 'person') {
return -1;
/*
} else if (a.startTime < b.startTime || a.startTime > b.startTime) {
return a.startTime - b.startTime;
*/
} else {
return (b.endTime - b.startTime) - (a.endTime - a.startTime);
}
@ -857,7 +863,7 @@ Ox.Calendar = function(options, self) {
if (line == lineEvents.length) {
lineEvents[line] = [];
}
lineEvents[line].push(event);
lineEvents[line].push(event);
});
self.$content.find('.OxLine').remove();
height = lineEvents.length * 16;