fix error
This commit is contained in:
parent
5ee197fdff
commit
4c3ffc2179
|
@ -39,27 +39,29 @@
|
||||||
</div>
|
</div>
|
||||||
<%= stylesheet_link_tag "calendar_widget1" %>
|
<%= stylesheet_link_tag "calendar_widget1" %>
|
||||||
<script>
|
<script>
|
||||||
if(document.getElementById("calendar-widget_module") == null){
|
$(document).ready(function(){
|
||||||
var tag = document.createElement('script');
|
if(document.getElementById("calendar-widget_module") == null){
|
||||||
tag.setAttribute("id", "calendar-widget_module");
|
var tag = document.createElement('script');
|
||||||
tag.src = "/assets/calendar_widget.js";
|
tag.setAttribute("id", "calendar-widget_module");
|
||||||
tag.onload = function(){
|
tag.src = "/assets/calendar_widget.js";
|
||||||
$("div.widget-calendar-1[data-module=calendar]").each(function(index){
|
tag.onload = function(){
|
||||||
var calendar = $(this),
|
$("div.widget-calendar-1[data-module=calendar]").each(function(index){
|
||||||
cmi = new CalendarModuleMonth1(new Date(), calendar,calendar.data("subpart-id"),"{{more_url}}",false);
|
var calendar = $(this),
|
||||||
cmi.currentMonth();
|
cmi = new CalendarModuleMonth1(new Date(), calendar,calendar.data("subpart-id"),"{{more_url}}",false);
|
||||||
calendar.find("div.w-calendar-nav a").on("click",function(){
|
cmi.currentMonth();
|
||||||
var el = $(this);
|
calendar.find("div.w-calendar-nav a").on("click",function(){
|
||||||
if(el.hasClass("w-calendar-nav-prev")){
|
var el = $(this);
|
||||||
cmi.prevMonth();
|
if(el.hasClass("w-calendar-nav-prev")){
|
||||||
}else if(el.hasClass("w-calendar-nav-next")){
|
cmi.prevMonth();
|
||||||
cmi.nextMonth();
|
}else if(el.hasClass("w-calendar-nav-next")){
|
||||||
}
|
cmi.nextMonth();
|
||||||
return false;
|
}
|
||||||
|
return false;
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
var head = document.getElementsByTagName("head");
|
||||||
|
head[0].appendChild(tag);
|
||||||
}
|
}
|
||||||
var head = document.getElementsByTagName("head");
|
});
|
||||||
head[0].appendChild(tag);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
|
@ -55,27 +55,29 @@
|
||||||
</div>
|
</div>
|
||||||
<%= stylesheet_link_tag "calendar_widget2" %>
|
<%= stylesheet_link_tag "calendar_widget2" %>
|
||||||
<script>
|
<script>
|
||||||
if(document.getElementById("calendar-widget_module2") == null){
|
$(document).ready(function(){
|
||||||
var tag = document.createElement('script');
|
if(document.getElementById("calendar-widget_module2") == null){
|
||||||
tag.setAttribute("id", "calendar-widget_module2");
|
var tag = document.createElement('script');
|
||||||
tag.src = "/assets/calendar_widget2.js";
|
tag.setAttribute("id", "calendar-widget_module2");
|
||||||
tag.onload = function(){
|
tag.src = "/assets/calendar_widget2.js";
|
||||||
$("div.widget-calendar-2[data-module=calendar]").each(function(index){
|
tag.onload = function(){
|
||||||
var calendar = $(this),
|
$("div.widget-calendar-2[data-module=calendar]").each(function(index){
|
||||||
cmi = new CalendarModuleMonth2(new Date(), calendar,calendar.data("subpart-id"),"{{more_url}}",false);
|
var calendar = $(this),
|
||||||
cmi.currentMonth();
|
cmi = new CalendarModuleMonth2(new Date(), calendar,calendar.data("subpart-id"),"{{more_url}}",false);
|
||||||
calendar.find("div.w-calendar-nav a").on("click",function(){
|
cmi.currentMonth();
|
||||||
var el = $(this);
|
calendar.find("div.w-calendar-nav a").on("click",function(){
|
||||||
if(el.hasClass("w-calendar-nav-prev")){
|
var el = $(this);
|
||||||
cmi.prevMonth();
|
if(el.hasClass("w-calendar-nav-prev")){
|
||||||
}else if(el.hasClass("w-calendar-nav-next")){
|
cmi.prevMonth();
|
||||||
cmi.nextMonth();
|
}else if(el.hasClass("w-calendar-nav-next")){
|
||||||
}
|
cmi.nextMonth();
|
||||||
return false;
|
}
|
||||||
|
return false;
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
var head = document.getElementsByTagName("head");
|
||||||
|
head[0].appendChild(tag);
|
||||||
}
|
}
|
||||||
var head = document.getElementsByTagName("head");
|
});
|
||||||
head[0].appendChild(tag);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue