File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
browser/src/control/jsdialog Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,14 @@ JSDialog.listbox = function (
4040 selectedEntryIsString = isNaN ( parseInt ( data . selectedEntries [ 0 ] as any ) ) ;
4141 if ( title && title . length ) {
4242 // pass
43- } else if ( selectedEntryIsString )
43+ } else if ( selectedEntryIsString ) {
4444 title = builder . _cleanText ( data . selectedEntries [ 0 ] as string ) ;
45- else if (
45+ } else if (
4646 data . entries &&
4747 data . entries . length > ( data . selectedEntries [ 0 ] as number )
48- )
48+ ) {
4949 title = data . entries [ data . selectedEntries [ 0 ] as number ] ;
50+ }
5051 }
5152 title = builder . _cleanText ( title ) ;
5253
@@ -133,14 +134,18 @@ JSDialog.listbox = function (
133134 }
134135 }
135136 }
136- // no selected entry; set the visible value to empty string unless the font is not included in the entries
137+
138+ // no selected entry; set the visible value to empty string
139+ // unless the font is not included in the entries
137140 if ( ! hasSelectedEntry ) {
138141 if ( title ) {
139142 const newOption = window . L . DomUtil . create ( 'option' , '' , listbox ) ;
140143 newOption . value = ++ index ;
141144 newOption . innerText = title ;
142145 newOption . selected = true ;
143- } else $ ( listbox ) . val ( '' ) ;
146+ } else {
147+ $ ( listbox ) . val ( '' ) ;
148+ }
144149 }
145150
146151 return false ;
You can’t perform that action at this time.
0 commit comments