Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix up for sparse calendar provider array

  • Loading branch information...
commit 4bf0ecc019112a52fcd498dc34ef53f09c9bed51 1 parent 9f945c6
@tardate authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 jquery.addtocal.js
View
7 jquery.addtocal.js
@@ -103,7 +103,10 @@
select: function(event, ui) {
var eventDetails = ui.sanitizeEventDetails( ui.getEventDetails($(this)) );
- var link = ui.calendars[ ui.selectedCalendarTarget ].formatlink(eventDetails);
+ var calendar_provider = $.grep(ui.calendars, function(element, index){
+ return (element.value == ui.selectedCalendarTarget);
+ });
+ var link = calendar_provider[0].formatlink(eventDetails);
if(link) window.open(link);
},
},
@@ -169,7 +172,7 @@
var self = this;
self.source=[];
$.each( this.options.calendars, function(index, value) {
- if(value.enabled(self)) self.source.push( {value: index, label: value.label } );
+ if(value.enabled(self)) self.source.push( {value: value.value, label: value.label } );
});
},
Please sign in to comment.
Something went wrong with that request. Please try again.