File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 */
99
1010function showSettings ( selector ) {
11- var buttons = { } ;
12- buttons [ Messages . strApply ] = function ( ) {
11+ // Keeping a clone to restore in case the user cancels the operation
12+ var $clone = $ ( selector + ' .page_settings' ) . clone ( true ) ;
13+
14+ $ ( '#pageSettingsModalApplyButton' ) . on ( 'click' , function ( ) {
1315 $ ( '.config-form' ) . trigger ( 'submit' ) ;
14- } ;
16+ } ) ;
1517
16- buttons [ Messages . strCancel ] = function ( ) {
17- $ ( this ) . dialog ( 'close' ) ;
18- } ;
18+ $ ( '#pageSettingsModalCloseButton,#pageSettingsModalCancelButton' ) . on ( 'click' , function ( ) {
19+ $ ( selector + ' .page_settings' ) . replaceWith ( $clone ) ;
20+ $ ( '#pageSettingsModal' ) . modal ( 'hide' ) ;
21+ } ) ;
1922
20- // Keeping a clone to restore in case the user cancels the operation
21- var $clone = $ ( selector + ' .page_settings' ) . clone ( true ) ;
22- $ ( selector )
23- . dialog ( {
24- title : Messages . strPageSettings ,
25- width : 700 ,
26- minHeight : 250 ,
27- modal : true ,
28- open : function ( ) {
29- $ ( this ) . dialog ( 'option' , 'maxHeight' , $ ( window ) . height ( ) - $ ( this ) . offset ( ) . top ) ;
30- } ,
31- close : function ( ) {
32- $ ( selector + ' .page_settings' ) . replaceWith ( $clone ) ;
33- } ,
34- buttons : buttons
35- } ) ;
23+ $ ( '#pageSettingsModal' ) . modal ( 'show' ) ;
24+ $ ( '#pageSettingsModal' ) . find ( '.modal-body' ) . first ( ) . html ( $ ( selector ) ) ;
25+ $ ( selector ) . css ( 'display' , 'block' ) ;
3626}
3727
3828function showPageSettings ( ) {
Original file line number Diff line number Diff line change 11{{ include (' modals/function_confirm.twig' ) }}
22{{ include (' modals/add_index.twig' ) }}
3+ {{ include (' modals/page_settings.twig' ) }}
34{% if not is_ajax %}
45 </div >
56{% endif %}
Original file line number Diff line number Diff line change 1+ <div class =" modal fade" id =" pageSettingsModal" tabindex =" -1" aria-labelledby =" pageSettingsModalLabel" aria-hidden =" true" >
2+ <div class =" modal-dialog modal-lg" id =" pageSettingsModalDialog" >
3+ <div class =" modal-content" >
4+ <div class =" modal-header" >
5+ <h5 class =" modal-title" id =" pageSettingsModalLabel" >{% trans ' Page-related settings' %}</h5 >
6+ <button type =" button" class =" btn-close" id =" pageSettingsModalCloseButton" aria-label =" {% trans ' Close' %}" ></button >
7+ </div >
8+ <div class =" modal-body" ></div >
9+ <div class =" modal-footer" >
10+ <button type =" button" class =" btn btn-secondary" id =" pageSettingsModalApplyButton" >{% trans ' Apply' %}</button >
11+ <button type =" button" class =" btn btn-secondary" id =" pageSettingsModalCancelButton" >{% trans ' Cancel' %}</button >
12+ </div >
13+ </div >
14+ </div >
15+ </div >
Original file line number Diff line number Diff line change @@ -126,7 +126,9 @@ public function testAjax(): void
126126 $ footer ->setAjax (true );
127127 $ template = new Template ();
128128 $ this ->assertEquals (
129- $ template ->render ('modals/function_confirm ' ) . "\n" . $ template ->render ('modals/add_index ' ) . "\n" ,
129+ $ template ->render ('modals/function_confirm ' ) . "\n"
130+ . $ template ->render ('modals/add_index ' ) . "\n"
131+ . $ template ->render ('modals/page_settings ' ) . "\n" ,
130132 $ footer ->getDisplay ()
131133 );
132134 }
@@ -167,7 +169,9 @@ public function testMinimal(): void
167169 $ template = new Template ();
168170 $ this ->assertEquals (
169171 $ template ->render ('modals/function_confirm ' ) . "\n"
170- . $ template ->render ('modals/add_index ' ) . "\n </div> \n </body> \n</html> \n" ,
172+ . $ template ->render ('modals/add_index ' ) . "\n"
173+ . $ template ->render ('modals/page_settings ' )
174+ . "\n </div> \n </body> \n</html> \n" ,
171175 $ footer ->getDisplay ()
172176 );
173177 }
You can’t perform that action at this time.
0 commit comments