List: Add selectbefore and selectafter events (fixes #353)
This commit is contained in:
parent
08423110e9
commit
2be6052276
1 changed files with 7 additions and 3 deletions
|
@ -535,9 +535,9 @@ Ox.List = function(options, self) {
|
||||||
function getNext() {
|
function getNext() {
|
||||||
var pos = -1;
|
var pos = -1;
|
||||||
if (self.selected.length) {
|
if (self.selected.length) {
|
||||||
pos = (self.options.orientation == 'both' ?
|
pos = (self.options.orientation == 'both'
|
||||||
self.selected[self.selected.length - 1] :
|
? self.selected[self.selected.length - 1]
|
||||||
Ox.max(self.selected)) + 1;
|
: Ox.max(self.selected)) + 1;
|
||||||
if (pos == self.$items.length) {
|
if (pos == self.$items.length) {
|
||||||
pos = -1;
|
pos = -1;
|
||||||
}
|
}
|
||||||
|
@ -1202,6 +1202,8 @@ Ox.List = function(options, self) {
|
||||||
if (pos > -1) {
|
if (pos > -1) {
|
||||||
select(pos);
|
select(pos);
|
||||||
scrollToPosition(pos);
|
scrollToPosition(pos);
|
||||||
|
} else if (self.selected.length) {
|
||||||
|
that.triggerEvent('selectafter');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1214,6 +1216,8 @@ Ox.List = function(options, self) {
|
||||||
if (pos > -1) {
|
if (pos > -1) {
|
||||||
select(pos);
|
select(pos);
|
||||||
scrollToPosition(pos);
|
scrollToPosition(pos);
|
||||||
|
} else if (self.selected.length) {
|
||||||
|
that.triggerEvent('selectbefore');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue