diff --git a/source/Ox.UI/js/Form/Ox.Form.js b/source/Ox.UI/js/Form/Ox.Form.js index 4245f165..4bab6825 100644 --- a/source/Ox.UI/js/Form/Ox.Form.js +++ b/source/Ox.UI/js/Form/Ox.Form.js @@ -123,7 +123,7 @@ Ox.Form = function(options, self) { } else { Ox.forEach(arguments[0], function(value, key) { var index = getItemIndexById(key); - index > -1 && Ox.print(key, value) + //index > -1 && Ox.print(key, value) index > -1 && self.options.items[index].options({value: value}); }); return that; diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index d99f9363..0180512f 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -45,14 +45,11 @@ Ox.List = function(options, self) { that = new Ox.Container({}, self) .defaults({ centered: false, - construct: null, draggable: false, format: [], itemHeight: 16, items: null, - - itemWidth: 16, keys: [], max: -1, @@ -1217,16 +1214,18 @@ Ox.List = function(options, self) { })); } - function updateSort() { + function updateSort(map) { var key = self.options.sort[0].key, operator = self.options.sort[0].operator; if (self.listLength > 1) { if (Ox.isArray(self.options.items)) { self.options.items.sort(function(a, b) { - var ret = 0 - if (a[key] < b[key]) { + var aValue = map ? map(a[key]) : a[key], + bValue = map ? map(b[key]) : b[key], + ret = 0 + if (aValue < bValue) { return operator == '+' ? -1 : 1 - } else if (a[key] > b[key]) { + } else if (aValue > bValue) { return operator == '+' ? 1 : -1; } return ret; @@ -1468,12 +1467,13 @@ Ox.List = function(options, self) { (key, operator) -> returns List Element key key to sort list by operator +/- sort ascending or descending + map function that maps values to sort values @*/ - that.sortList = function(key, operator) { + that.sortList = function(key, operator, map) { Ox.print('sortList', key, operator) if (key != self.options.sort[0].key || operator != self.options.sort[0].operator) { self.options.sort[0] = {key: key, operator: operator}; - updateSort(); + updateSort(map); that.triggerEvent('sort', self.options.sort[0]); } return that; diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index 548ba826..dbfa348e 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -6,7 +6,17 @@ Ox.TextList TextList Object (options) -> TextList Object (options, self) -> TextList Object options Options object - columns + columns <[o]|[]> + Fixme: There's probably more... + addable + editable + id + removable + operator default sort operator + sort function that maps values to sort values + title + visible + width columnsMovable columnsRemovable columnsResizable @@ -48,8 +58,6 @@ Ox.TextList = function(options, self) { .options(options || {}) .addClass('OxTextList'); - Ox.print('Ox.TextList self.options', self.options) - self.options.columns.forEach(function(v) { // fixme: can this go into a generic ox.js function? // fixme: and can't these just remain undefined? if (Ox.isUndefined(v.align)) { @@ -713,7 +721,11 @@ Ox.TextList = function(options, self) { toggleSelected(self.options.columns[self.selectedColumn].id); } } - that.$body.sortList(self.options.sort[0].key, self.options.sort[0].operator); + that.$body.sortList( + self.options.sort[0].key, + self.options.sort[0].operator, + self.options.columns[self.selectedColumn].sort + ); return that; }; diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 948fa358..324fa8f0 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -55,6 +55,9 @@ Ox.ListMap = function(options, self) { id: 'geoname', removable: false, operator: '+', + sort: function(v) { + return v.split(', ').reverse().join(', ') + }, title: 'Geoname', visible: true, width: 192 diff --git a/source/Ox.UI/js/Map/Ox.MapMarker.js b/source/Ox.UI/js/Map/Ox.MapMarker.js index f1a5a21d..2fa83922 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapMarker.js @@ -83,7 +83,7 @@ Ox.MapMarker = function(options) { } function getMarkerImage(options, callback) { - // unused + // fixme: unused options = Ox.extend({ background: [255, 0, 0], editing: false, diff --git a/source/Ox.UI/js/Map/Ox.MapMarkerImage.js b/source/Ox.UI/js/Map/Ox.MapMarkerImage.js index 83e322d5..560f79a6 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarkerImage.js +++ b/source/Ox.UI/js/Map/Ox.MapMarkerImage.js @@ -27,9 +27,12 @@ Ox.MapMarkerImage = (function() { options.type, options.mode, options.size, options.color.join(',') ].join(';'); + Ox.print('HELLO??') + if (!cache[index]) { var color = options.type == 'place' ? - Ox.merge(Ox.clone(options.color), [0.5]) : [0, 0, 0, 0], + Ox.merge(Ox.clone(options.color), [0.5]) : + options.type == 'result' ? [128, 128, 128, 0.5] : [0, 0, 0, 0], border = options.mode == 'normal' ? [0, 0, 0] : options.mode == 'selected' ? [255, 255, 255] : [128, 128, 255], c = Ox.canvas(options.size, options.size),