Javascript: ParagraphFormat.getDirection Method
Description
Gets the writing direction.
Syntax
<void> ParagraphFormat.getDirection(<RequestDirectionCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the writing direction. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates ParagraphFormat.getDirection in a practical document-editing workflow. It gets the writing direction.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.paragraphFormat.getDirection(
function(direction) {
if (!direction) {
console.warn("No direction was returned.");
return;
}
console.log("get direction result:", direction);
},
onTxError
);