From a5a833f3c11064ee292376b5d742a624b8f26ed2 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 3 Oct 2011 16:37:05 +0000 Subject: [PATCH] update ListCalendar --- source/Ox.UI/js/Calendar/Ox.ListCalendar.js | 33 ++++++++++++++------- source/Ox.UI/js/Map/Ox.ListMap.js | 4 +-- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js index 102e2e9a..4fa02e1d 100644 --- a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js +++ b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js @@ -9,15 +9,11 @@ Ox.ListCalendar = function(options, self) { self = self || {}; var that = Ox.Element({}, self) .defaults({ - addPlace: null, - editPlace: null, + events: [], height: 256, - labels: false, pageLength: 100, - places: null, - removePlace: null, selected: [], - sort: [{key: 'geoname', operator: '+'}], + sort: [{key: 'name', operator: '+'}], width: 256 }) .options(options || {}) @@ -172,14 +168,14 @@ Ox.ListCalendar = function(options, self) { columnsRemovable: true, columnsVisible: true, //items: Ox.clone(self.options.places), - items: self.options.places, + items: self.options.events, pageLength: self.options.pageLength, scrollbarVisible: true, sort: self.options.sort }) .bindEvent({ 'delete': removeItem, - init: initList, + init: initList, // fixme: won't fire from static list key_0: function() { self.$calendar.panToEvent(); }, @@ -205,6 +201,11 @@ Ox.ListCalendar = function(options, self) { self.$status = Ox.Element() .css({paddingTop: '2px', margin: 'auto', fontSize: '9px', textAlign: 'center'}) + .html( + Ox.formatNumber(self.options.events.length) + ' Event' + ( + self.options.events.length == 1 ? '' : 's' + ) + ) .appendTo(self.$listStatusbar); self.$calendar = Ox.Element(); @@ -214,7 +215,7 @@ Ox.ListCalendar = function(options, self) { }); self.$placeForm = Ox.Form({ - items: self.$placeFormItems, + items: [], width: 240 }) .css({margin: '8px'}) @@ -289,14 +290,22 @@ Ox.ListCalendar = function(options, self) { ); - function initList() { - + function initList(data) { + self.$status.html( + Ox.formatNumber(data.items) + ' Event' + ( + data.items == 1 ? '' : 's' + ) + ); } function openItem() { } + function removeItem() { + + } + function selectItem() { } @@ -320,4 +329,6 @@ Ox.ListCalendar = function(options, self) { }); } + return that; + }; \ No newline at end of file diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 729d4a90..863730ce 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -522,8 +522,8 @@ Ox.ListMap = function(options, self) { .appendTo(self.$placeForm); self.$placeStatusbar = Ox.Bar({ - size: 24 - }); + size: 24 + }); self.$newPlaceButton = Ox.Button({ title: 'New Place',