When I am sending the properties as name, value the name is sent as "name" instead of the argument value of name. Is there a fix for it? Right now I use case to send in right way.
Working one
/**
* Change properties of the elements
*/
this.changeProperties = function(type,value) {
switch(type)
{
case "stroke":
$.DrawEngine.changeProperties({"stroke":value});
break;
case "font-family":
$.DrawEngine.changeProperties({"font-family":value});
break;
}
};
Not working one
this.changeProperties = function(type,value) {
$.DrawEngine.changeProperties({"stroke":value});
}
Reason
it sends {type:"red"} instead of {"stroke": "red"}