forked from 0x2620/oxjs
fix alphabetical order of annotations with tags, fixes #681
This commit is contained in:
parent
c4de1a3a40
commit
bc3fedb125
4 changed files with 30 additions and 17 deletions
|
|
@ -11,6 +11,7 @@ Ox.ArrayEditable = function(options, self) {
|
|||
.defaults({
|
||||
clickLink: null,
|
||||
editable: true,
|
||||
getSortValue: null,
|
||||
highlight: '',
|
||||
itemName: 'item',
|
||||
items: [],
|
||||
|
|
@ -208,7 +209,6 @@ Ox.ArrayEditable = function(options, self) {
|
|||
self.editing = false;
|
||||
that.blurItem();
|
||||
}
|
||||
Ox.print('SELECT ITEM', self.options.selected, self.selected);
|
||||
that.find('.OxSelected').removeClass('OxSelected');
|
||||
self.selected > -1 && self.$items[self.selected].addClass('OxSelected');
|
||||
triggerSelectEvent();
|
||||
|
|
@ -279,7 +279,13 @@ Ox.ArrayEditable = function(options, self) {
|
|||
|
||||
function sortItems() {
|
||||
if (!Ox.isEmpty(self.options.sort)) {
|
||||
self.options.items = Ox.sortBy(self.options.items, self.options.sort);
|
||||
self.options.items = Ox.sortBy(
|
||||
self.options.items,
|
||||
self.options.sort,
|
||||
self.options.getSortValue
|
||||
? {value: self.options.getSortValue}
|
||||
: {}
|
||||
);
|
||||
self.selected = getSelectedPosition();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue