File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,21 +111,20 @@ <h2>Add Miniature{% if duplicate_of %} (Duplicated from ID {{ duplicate_of.id }}
111111 const uniqueIdInput = document . querySelector ( 'input[name="unique_id"]' ) ;
112112
113113 // Only update if not prefilled (no duplicate scenario)
114- const isPrefilled = { { 'true' if prefill is defined else 'false' }
115- } ;
114+ const isPrefilled = { { ( prefill is defined ) | tojson } } ;
116115
117- if ( seriesSelect && uniqueIdInput && ! isPrefilled ) {
118- seriesSelect . addEventListener ( 'change' , function ( ) {
119- const series = this . value ;
116+ if ( seriesSelect && uniqueIdInput && ! isPrefilled ) {
117+ seriesSelect . addEventListener ( 'change' , function ( ) {
118+ const series = this . value ;
120119
121- fetch ( '/miniatures/next-id/' + series )
122- . then ( response => response . json ( ) )
123- . then ( data => {
124- uniqueIdInput . value = data . next_id ;
125- } )
126- . catch ( error => console . error ( 'Error fetching next ID:' , error ) ) ;
127- } ) ;
128- }
120+ fetch ( '/miniatures/next-id/' + series )
121+ . then ( response => response . json ( ) )
122+ . then ( data => {
123+ uniqueIdInput . value = data . next_id ;
124+ } )
125+ . catch ( error => console . error ( 'Error fetching next ID:' , error ) ) ;
126+ } ) ;
127+ }
129128 } ) ;
130129</ script >
131130{% endblock %}
You can’t perform that action at this time.
0 commit comments