Auth: convert auth views and verification email to Nova layout
This commit is contained in:
@@ -492,13 +492,50 @@ if ($('.switch').length && $.fn.bootstrapSwitch) {
|
||||
}
|
||||
|
||||
/**** Datepicker ****/
|
||||
if ($('.datepicker').length && $.fn.datepicker) {
|
||||
$('.datepicker').each(function () {
|
||||
var datepicker_inline = $(this).data('inline') ? $(this).data('inline') : false;
|
||||
$(this).datepicker({
|
||||
inline: datepicker_inline
|
||||
/**
|
||||
* Datepicker initialization helper.
|
||||
* Ensures any newly added .datepicker inside a popup/modal is initialized.
|
||||
*/
|
||||
function initDatepickers(root) {
|
||||
if (!$.fn.datepicker) return;
|
||||
root = root || document;
|
||||
var $root = $(root instanceof jQuery ? root[0] : root);
|
||||
// Initialize datepickers that don't yet have the jQuery UI marker class
|
||||
$root.find('.datepicker').each(function () {
|
||||
var $el = $(this);
|
||||
if ($el.hasClass('hasDatepicker')) return;
|
||||
var datepicker_inline = $el.data('inline') ? $el.data('inline') : false;
|
||||
$el.datepicker({ inline: datepicker_inline });
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize on initial page load
|
||||
initDatepickers(document);
|
||||
|
||||
// Re-initialize when Bootstrap modals are shown (common popup pattern)
|
||||
$(document).on('shown.bs.modal', '.modal', function () {
|
||||
initDatepickers(this);
|
||||
});
|
||||
|
||||
// Observe DOM mutations and initialize datepickers for added nodes (covers custom popups)
|
||||
if (window.MutationObserver) {
|
||||
var _dpObserver = new MutationObserver(function (mutations) {
|
||||
mutations.forEach(function (m) {
|
||||
m.addedNodes && Array.prototype.forEach.call(m.addedNodes, function (node) {
|
||||
if (node.nodeType !== 1) return;
|
||||
// If the added node itself has .datepicker or contains them, init
|
||||
var $node = $(node);
|
||||
if ($node.is('.datepicker') || $node.find('.datepicker').length) {
|
||||
initDatepickers(node);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
try {
|
||||
_dpObserver.observe(document.body, { childList: true, subtree: true });
|
||||
} catch (e) {
|
||||
// ignore observer errors on very old browsers
|
||||
}
|
||||
}
|
||||
|
||||
/**** Datetimepicker ****/
|
||||
|
||||
Reference in New Issue
Block a user