blob: 2a54979e4e93790b9431e8f7bd41f2b03682a555 [file] [log] [blame]
var TextExpressionInterface = (function(){
return function(elem){
var _prevValue, _sourceText;
function _thisLayerFunction(name){
switch(name){
case 'ADBE Text Document':
return _thisLayerFunction.sourceText;
}
}
Object.defineProperty(_thisLayerFunction, 'sourceText', {
get: function(){
elem.textProperty.getValue()
var stringValue = elem.textProperty.currentData.t;
if(stringValue !== _prevValue) {
elem.textProperty.currentData.t = _prevValue;
_sourceText = new String(stringValue);
//If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
_sourceText.value = stringValue ? stringValue : new String(stringValue);
}
return _sourceText;
}
});
return _thisLayerFunction;
};
}());