Skip to content

Commit

Permalink
Fixes an issue where disabled block add buttons were still clickable. F…
Browse files Browse the repository at this point in the history
…ixes #58
  • Loading branch information
mmikkel committed Nov 10, 2022
1 parent cc86520 commit 60ac61f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
### Fixed
- Fixes an issue where disabled block type add buttons would still be clickable. #58

## 2.1.1 - 2022-10-05
### Improved
- Improved styling for block tabs
Expand Down
4 changes: 3 additions & 1 deletion src/assetbundles/matrixmate/dist/css/MatrixMate.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ h6 + [data-matrixmate-group] {
}

[data-matrixmate-group] a.disabled,
.matrixmate-menu a.disabled {
.matrixmate-menu a.disabled,
button.matrixmate-disabled,
a.matrixmate-disabled {
pointer-events: none;
}
10 changes: 5 additions & 5 deletions src/assetbundles/matrixmate/dist/js/MatrixMate.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
const $li = $('<li/>');
const $a = $('<a/>').attr('data-type', type).text($origTypeBtn.text());
if (disable) {
$a.addClass('disabled');
$a.addClass('disabled matrixmate-disabled');
}

$li.append($a).appendTo($mainUl);
Expand Down Expand Up @@ -547,9 +547,9 @@
// Update Add buttons
this.$field.find('> .buttons .btn[data-type="' + type + '"], > .matrixmate-buttons .btn[data-type="' + type + '"]').each(function () {
if (disable) {
$(this).addClass('disabled');
$(this).addClass('disabled matrixmate-disabled');
} else {
$(this).removeClass('disabled');
$(this).removeClass('disabled matrixmate-disabled');
}
});

Expand All @@ -565,9 +565,9 @@
}
$container.find('a[data-type="' + type + '"]').each(function () {
if (disable) {
$(this).addClass('disabled');
$(this).addClass('disabled matrixmate-disabled');
} else {
$(this).removeClass('disabled');
$(this).removeClass('disabled matrixmate-disabled');
}
});
});
Expand Down

0 comments on commit 60ac61f

Please sign in to comment.