pad_editbar: Move `dropdowns` initialization to constructor

This avoids null dereference if a buggy caller calls
`toggleDropDown('none')` before `init()`. (Ideally the caller would be
fixed, but this is not always feasible.)
pull/5152/head
Richard Hansen 2021-07-15 18:05:03 -04:00
parent 42b0b1bf00
commit fda34407f9
1 changed files with 1 additions and 2 deletions

View File

@ -124,10 +124,9 @@ const syncAnimation = (() => {
exports.padeditbar = {
_editbarPosition: 0,
dropdowns: [],
init() {
this.dropdowns = [];
$('#editbar .editbarbutton').attr('unselectable', 'on'); // for IE
this.enable();
$('#editbar [data-key]').each((i, elt) => {