1
0
Fork 0
forked from 0x2620/oxjs

Ox.getPositionById() -> Ox.getIndexById()

This commit is contained in:
rolux 2012-01-04 13:41:05 +05:30
commit 8097cc7812
19 changed files with 23 additions and 30 deletions

View file

@ -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();

View file

@ -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);