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
parent
42b0b1bf00
commit
fda34407f9
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue