blob: f26cc30c1dfc15fe7a766fc877f83c4379064c52 [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;
};
}());