Prevent datepickers to raise an error from erb file if they don't exist on the current page
This commit is contained in:
parent
9ab93501e5
commit
6c53e0ef6d
@ -131,7 +131,9 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
|
|||||||
o << "</span>"
|
o << "</span>"
|
||||||
o << "<script>"
|
o << "<script>"
|
||||||
o << "//<![CDATA[\n"
|
o << "//<![CDATA[\n"
|
||||||
|
o << " if(typeof datepickerOptions !== 'undefined'){\n"
|
||||||
o << " $(function() { $('#StartDateInput input').addClass('date').datepickerFallback(datepickerOptions); });\n"
|
o << " $(function() { $('#StartDateInput input').addClass('date').datepickerFallback(datepickerOptions); });\n"
|
||||||
|
o << " }\n"
|
||||||
o << "//]]>\n"
|
o << "//]]>\n"
|
||||||
o << "</script>"
|
o << "</script>"
|
||||||
end
|
end
|
||||||
@ -145,7 +147,9 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
|
|||||||
o << "</span>"
|
o << "</span>"
|
||||||
o << "<script>"
|
o << "<script>"
|
||||||
o << "//<![CDATA[\n"
|
o << "//<![CDATA[\n"
|
||||||
|
o << " if(typeof datepickerOptions !== 'undefined'){\n"
|
||||||
o << " $(function() { $('#DueDateInput input').addClass('date').datepickerFallback(datepickerOptions); });\n"
|
o << " $(function() { $('#DueDateInput input').addClass('date').datepickerFallback(datepickerOptions); });\n"
|
||||||
|
o << " }\n"
|
||||||
o << "//]]>\n"
|
o << "//]]>\n"
|
||||||
o << "</script>"
|
o << "</script>"
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user