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 = {
|
exports.padeditbar = {
|
||||||
_editbarPosition: 0,
|
_editbarPosition: 0,
|
||||||
|
dropdowns: [],
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.dropdowns = [];
|
|
||||||
|
|
||||||
$('#editbar .editbarbutton').attr('unselectable', 'on'); // for IE
|
$('#editbar .editbarbutton').attr('unselectable', 'on'); // for IE
|
||||||
this.enable();
|
this.enable();
|
||||||
$('#editbar [data-key]').each((i, elt) => {
|
$('#editbar [data-key]').each((i, elt) => {
|
||||||
|
|
Loading…
Reference in New Issue