File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change 119119 dataUrl : "books/" ,
120120 dataElementId : "#books-table" ,
121121 dataKey : "table" ,
122- addModalFormFunction : updateBookModalForm
122+ addModalFormFunction : reinstantiateModalForms
123123 }
124124 } ) ;
125125 }
@@ -153,22 +153,35 @@ <h4>
153153 dataUrl : "books/" ,
154154 dataElementId : "#books-table" ,
155155 dataKey : "table" ,
156- addModalFormFunction : updateBookModalForm
156+ addModalFormFunction : reinstantiateModalForms
157157 }
158158 } ) ;
159159 } ) ;
160160 }
161161 updateBookModalForm ( ) ;
162162
163163 // Delete book buttons - formURL is retrieved from the data of the element
164- $ ( ".delete-book" ) . each ( function ( ) {
165- $ ( this ) . modalForm ( { formURL : $ ( this ) . data ( "form-url" ) , isDeleteForm : true } ) ;
166- } ) ;
164+ function deleteBookModalForm ( ) {
165+ $ ( ".delete-book" ) . each ( function ( ) {
166+ $ ( this ) . modalForm ( { formURL : $ ( this ) . data ( "form-url" ) , isDeleteForm : true } ) ;
167+ } ) ;
168+ }
169+ deleteBookModalForm ( ) ;
167170
168171 // Read book buttons
169- $ ( ".read-book" ) . each ( function ( ) {
170- $ ( this ) . modalForm ( { formURL : $ ( this ) . data ( "form-url" ) } ) ;
171- } ) ;
172+ function readBookModalForm ( ) {
173+ $ ( ".read-book" ) . each ( function ( ) {
174+ $ ( this ) . modalForm ( { formURL : $ ( this ) . data ( "form-url" ) } ) ;
175+ } ) ;
176+ }
177+ readBookModalForm ( ) ;
178+
179+ function reinstantiateModalForms ( ) {
180+ createBookAsyncModalForm ( ) ;
181+ readBookModalForm ( ) ;
182+ updateBookModalForm ( ) ;
183+ deleteBookModalForm ( ) ;
184+ }
172185
173186 // Filter books button
174187 $ ( "#filter-book" ) . each ( function ( ) {
You can’t perform that action at this time.
0 commit comments