Skip to content

Commit

Permalink
Merge pull request #13195 from craftcms/bugfix/13194-matrix-addBlockM…
Browse files Browse the repository at this point in the history
…enuBtn-check

additional check for matrix $addBlockMenuBtn

[ci skip]
  • Loading branch information
brandonkelly committed May 15, 2023
2 parents 29c2a8e + fc3b71d commit 7714d90
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed a SQL error that could occur when updating to Craft 3.8 on PostgreSQL. ([#13186](https://github.com/craftcms/cms/issues/13186))
- Fixed a JavaScript error that occurred for Matrix inputs with static blocks. ([#13194](https://github.com/craftcms/cms/issues/13194))
- Fixed the vertical alignment of element labels. ([#13168](https://github.com/craftcms/cms/issues/13168))

## 3.8.10.2 - 2023-05-10
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/matrix/dist/MatrixInput.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/matrix/dist/MatrixInput.js.map

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/web/assets/matrix/src/MatrixInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@
this.addBlock(type);
});

this.$addBlockMenuBtn.menubtn();
this.$addBlockMenuBtn.data('menubtn').on('optionSelect', (ev) => {
this.addBlock($(ev.option).data('type'));
});
if (this.$addBlockMenuBtn.length > 0) {
this.$addBlockMenuBtn.menubtn();
this.$addBlockMenuBtn.data('menubtn').on('optionSelect', (ev) => {
this.addBlock($(ev.option).data('type'));
});
}

this.updateAddBlockBtn();

Expand Down

0 comments on commit 7714d90

Please sign in to comment.