Skip to content

Commit

Permalink
Added context data in component script commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
feuzeu committed Dec 31, 2024
1 parent fed5945 commit 87f9eca
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
11 changes: 8 additions & 3 deletions dist/jaxon.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var jaxon = {
version: {
major: '5',
minor: '0',
patch: '0-beta.10',
patch: '0-beta.11',
},

debug: {
Expand Down Expand Up @@ -1474,8 +1474,13 @@ window.jaxon = jaxon;
*/
self.execExpr = (xExpression, xContext = {}) => {
if(types.isObject(xExpression)) {
const xOptions = { value: null, context: xContext };
xGlobal.target = xOptions.context.target;
// Some commands are meant to executed in the context of the component.
if (xContext.component === true && (xContext.target)) {
xGlobal.target = xContext.target;
}
// Remove the component field from the xContext object.
const { component: _, ...xNewContext } = xContext;
const xOptions = { value: null, context: xNewContext };
execExpression(xExpression, xOptions);
}
};
Expand Down
Loading

0 comments on commit 87f9eca

Please sign in to comment.