Widget Next/Prev Month navigation
-
Hello,
I have a problem with Prev/Next months link for the widget.
The problem come from JS scripts. So I replace minified script with non minified script and here is the problem :
$(".eo_widget_calendar").off("click").on("click", 'tfoot a', function (a) { a.preventDefault(); var b = $(this).closest(".eo_widget_calendar").attr("id"); //Defaults var cal = {showpastevents: 1, 'show-long': 0, 'link-to-single': 0 }; //Shortcode widget calendar if( typeof EOAjax !== "undefined" && typeof eventorganiser.widget_calendars !== "undefined" ){ cal = eventorganiser.widget_calendars[b]; } //Widget calendar if (typeof eo_widget_cal !== "undefined") { cal = eo_widget_cal[b]; } //Set month cal.eo_month = eveorg_getParameterByName("eo_month", $(this).attr("href")); $.getJSON(EOAjaxFront.adminajax + "?action=eo_widget_cal", cal,function (a) {$("#" + b + "_content").html(a);}); });
cal is undefined because eo_widget_cal[b] is undefined because b is undefined.
If I add a test like typeof eo_widget_cal[b] !== “undefined” the error disapear but the navigation doesn’t work because b is undefined :-/So I change the code for this and it work :
var b = $(this).closest(".eo_widget_calendar div").attr("id").replace(/_content$/, "");
In fact there is no DOM element with a class name like eo_widget_calendar that have an id.
IO hope that this will help.
Regards.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Widget Next/Prev Month navigation’ is closed to new replies.