forked from 0x2620/oxjs
Ox.getPositionById() -> Ox.getIndexById()
This commit is contained in:
parent
4ca01b2bfa
commit
8097cc7812
19 changed files with 23 additions and 30 deletions
|
|
@ -748,7 +748,7 @@ Ox.Calendar = function(options, self) {
|
|||
function getEventLine(id) {
|
||||
var line = -1;
|
||||
Ox.forEach(self.lineEvents, function(events, line_) {
|
||||
if (Ox.getPositionById(events, id) > -1) {
|
||||
if (Ox.getIndexById(events, id) > -1) {
|
||||
line = line_;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1261,7 +1261,7 @@ Ox.Calendar = function(options, self) {
|
|||
|
||||
that.removeEvent = function() {
|
||||
Ox.Log('Calendar', 'REMOVE ... SELF.OPTIONS', self.options)
|
||||
var index = Ox.getPositionById(self.options.events, self.options.selected);
|
||||
var index = Ox.getIndexById(self.options.events, self.options.selected);
|
||||
self.options.events.splice(index, 1);
|
||||
getLines();
|
||||
renderCalendar();
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ Ox.ListCalendar = function(options, self) {
|
|||
|
||||
function editEvent(key, value) {
|
||||
var id = self.selectedEvent,
|
||||
index = Ox.getPositionById(self.options.events, id),
|
||||
index = Ox.getIndexById(self.options.events, id),
|
||||
data = {id: id};
|
||||
data[key] = value;
|
||||
self.options.editEvent(data, function(result) {
|
||||
|
|
@ -552,7 +552,7 @@ Ox.ListCalendar = function(options, self) {
|
|||
|
||||
function removeEvent() {
|
||||
var id = self.selectedEvent,
|
||||
index = Ox.getPositionById(self.options.events, id);
|
||||
index = Ox.getIndexById(self.options.events, id);
|
||||
self.options.removeEvent({id: id}, function(result) {
|
||||
if (result.status.code == '200') {
|
||||
self.options.events.splice(index, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue