File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,9 +181,29 @@ function del() {
181181}
182182
183183function openHeader ( ) {
184- $ ( "#header-button" ) . hide ( ) ;
185- $ ( "#new-header-container" ) . show ( ) ;
186- $ ( "#new-header" ) . focus ( ) ;
184+ BootstrapDialog . show ( {
185+ title : 'Add Header' ,
186+ message : '<input autocomplete="on" id="dialog-new-header" type="text" class="form-control" placeholder="New Header…">' ,
187+ buttons : [ {
188+ label : 'Add' ,
189+ cssClass : 'btn-primary' ,
190+ action : function ( dialog ) {
191+ var headerValue = $ ( '#dialog-new-header' ) . val ( ) ;
192+ if ( headerValue ) {
193+ addHeader ( headerValue ) ;
194+ dialog . close ( ) ;
195+ }
196+ }
197+ } , {
198+ label : 'Cancel' ,
199+ action : function ( dialog ) {
200+ dialog . close ( ) ;
201+ }
202+ } ] ,
203+ onshown : function ( dialog ) {
204+ $ ( '#dialog-new-header' ) . focus ( ) ;
205+ }
206+ } ) ;
187207}
188208
189209function closeHeader ( ) {
You can’t perform that action at this time.
0 commit comments