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 8
8
try :
9
9
from pydantic import Field , validator
10
10
from pydantic .env_settings import BaseSettings , SettingsSourceCallable
11
- except : # pragma: no cover
11
+ except Exception : # pragma: no cover
12
12
from pydantic .v1 import Field , validator # type: ignore
13
13
from pydantic .v1 .env_settings import ( # type: ignore
14
14
BaseSettings ,
@@ -48,7 +48,7 @@ class WidgetSettings(BaseSettings): # pyright: ignore
48
48
bootstrap_icon_css_url : Optional [str ] = (
49
49
"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css"
50
50
)
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/"
52
52
debug : bool = Field (default_factory = lambda : getattr (django_settings , "DEBUG" , True ))
53
53
54
54
@validator ("addon_icon_classes" )
Original file line number Diff line number Diff line change 43
43
44
44
document . addEventListener ( 'DOMContentLoaded' , function ( event ) {
45
45
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
+ }
50
57
} ) ;
58
+ observer . observe ( document , { childList : true , subtree : true } ) ;
51
59
} ) ;
52
60
53
61
/**
You can’t perform that action at this time.
0 commit comments