Skip to content

Commit

Permalink
Ensure values
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Feb 3, 2021
1 parent 3032e73 commit e90057f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/grapesjs-style-gradient.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/grapesjs-style-gradient.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grapesjs-style-gradient",
"version": "2.0.4",
"version": "2.0.13",
"description": "Add gradient input to the Style Manager in GrapesJS",
"main": "dist/grapesjs-style-gradient.min.js",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion src/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default (editor, config = {}) => {
// direction of a gradient color
const dir = gp.getDirection();
const valueDir = defDir.filter(i => dir.indexOf(i) >= 0)[0] || dir;
gp.setDirection(valueDir); // Ensure the new value
inputType && inputType.setValue(gp.getType());
inputDirection && inputDirection.setValue(valueDir);
const handlers = gp.getHandlers();
Expand Down Expand Up @@ -131,7 +132,7 @@ export default (editor, config = {}) => {
propInput.render();
propInput.model.on('change:value', (model, val, opts = {}) => {
updateLastOpts(opts);
gp[input[2]](model.getFullValue() || model.getDefaultValue(), { complete: !opts.avoidStore });
gp.el && gp[input[2]](model.getFullValue() || model.getDefaultValue(), { complete: !opts.avoidStore });
onCustomInputChange({ model, input, inputDirection, inputType, opts });
});
fields.appendChild(propInput.el);
Expand Down

0 comments on commit e90057f

Please sign in to comment.