Skip to content

Commit

Permalink
Added support for "parameterChanged" function
Browse files Browse the repository at this point in the history
  • Loading branch information
msawired committed Mar 29, 2022
1 parent 6128740 commit 2c74b56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions opc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class OPC {

static set = function (variableName, value){
OPC.options[variableName].value = value;
if (typeof window.parameterChanged == 'function') {
window.parameterChanged(variableName, value);
}
}

static minimize = function (){
Expand All @@ -54,14 +57,12 @@ class OPC {
}

static callParentFunction = function (functionName, arg = {}) {
//this.console.log(arg);
// below might fail if arg can not be cloned to be sent over.
// console.profile('callParentFunction');
console.log(arg);
try {
//try sending as is
window.parent.postMessage({
'messageType': functionName,
'message': window.OP_makeTransmittable(arg, 0)
'message': arg
}, '*');
} catch (error) {
console.log('postMessage', error);
Expand Down

0 comments on commit 2c74b56

Please sign in to comment.