Skip to content

Commit

Permalink
Fix issue when remove a Sass Override item
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonny committed Jun 24, 2022
1 parent dc2cfd4 commit a6e3cf8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions assets/js/astroid-framework.js
Expand Up @@ -372,6 +372,15 @@ astroidFramework.directive("astroidsassoverrides", ["$http", function () {
if (_c) {
var _overrides = $scope.overrides;
_overrides.splice(_index, 1);
if (_overrides[_index]['color'] === true) {
$(".sass-variable-" + _index + "-value").spectrum(spectrumConfig);
$(".sass-variable-" + _index + "-value").spectrum("set", _overrides[_index]['value']);
}
for (let i = _index+1; i < _overrides.length; i++) {
if (_overrides[i]['color'] === true) {
$(".sass-variable-" + i + "-value").spectrum("set", _overrides[i]['value']);
}
}
$scope.overrides = _overrides
}
};
Expand Down

0 comments on commit a6e3cf8

Please sign in to comment.