File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
src/bootstrap_datepicker_plus
static/bootstrap_datepicker_plus/js Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 88try :
99 from pydantic import Field , validator
1010 from pydantic .env_settings import BaseSettings , SettingsSourceCallable
11- except : # pragma: no cover
11+ except Exception : # pragma: no cover
1212 from pydantic .v1 import Field , validator # type: ignore
1313 from pydantic .v1 .env_settings import ( # type: ignore
1414 BaseSettings ,
@@ -48,7 +48,7 @@ class WidgetSettings(BaseSettings): # pyright: ignore
4848 bootstrap_icon_css_url : Optional [str ] = (
4949 "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css"
5050 )
51- app_static_url = "https://cdn.jsdelivr.net/gh/monim67/django-bootstrap-datepicker-plus@5.0.2 /src/bootstrap_datepicker_plus/static/bootstrap_datepicker_plus/"
51+ app_static_url = "https://cdn.jsdelivr.net/gh/monim67/django-bootstrap-datepicker-plus@5.0.6 /src/bootstrap_datepicker_plus/static/bootstrap_datepicker_plus/"
5252 debug : bool = Field (default_factory = lambda : getattr (django_settings , "DEBUG" , True ))
5353
5454 @validator ("addon_icon_classes" )
Original file line number Diff line number Diff line change 4343
4444 document . addEventListener ( 'DOMContentLoaded' , function ( event ) {
4545 setTimeout ( ( ) => findAndProcessInputs ( document ) ) ;
46- document . addEventListener ( 'DOMNodeInserted' , function ( event ) {
47- setTimeout ( ( ) => {
48- if ( event . target . querySelectorAll ) findAndProcessInputs ( event . target ) ;
49- } ) ;
46+ const observer = new MutationObserver ( ( mutationsList , observer ) => {
47+ for ( const mutation of mutationsList ) {
48+ if ( mutation . type === 'childList' ) {
49+ const addedNodes = Array . from ( mutation . addedNodes ) ;
50+ addedNodes . forEach ( node => {
51+ if ( node . querySelectorAll ) {
52+ findAndProcessInputs ( node ) ;
53+ }
54+ } ) ;
55+ }
56+ }
5057 } ) ;
58+ observer . observe ( document , { childList : true , subtree : true } ) ;
5159 } ) ;
5260
5361 /**
You can’t perform that action at this time.
0 commit comments