Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Dynamically created controls #8

Merged
merged 2 commits into from
May 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions bootstrap3_datetime/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,22 @@ def conv_datetime_format_js2py(cls, format):
var callback = function() {
$(function(){$("#%(picker_id)s:has(input:not([readonly],[disabled]))").datetimepicker(%(options)s);});
};
if(window.addEventListener)
// if window object id loaded already, call directly callback function
if (-1 != $.inArray(
document.readyState,
["loaded", "interactive", "complete"]
)
) {
callback();
}
else if (window.addEventListener) {
window.addEventListener("load", callback, false);
else if (window.attachEvent)
}
else if (window.attachEvent) {
window.attachEvent("onload", callback);
else window.onload = callback;
}
else
window.onload = callback;
})(window);
</script>'''

Expand Down