Class Text
Define a Text block to be displayed into a JBlocks.
- Defined in: jblocks.block.text.js
- Extends Block
Constructor Attributes | Constructor Name and Description |
---|---|
Text()
A Text block displays an uniformely formatted text. |
Method Summary
Class Detail
Text()
A Text block displays an uniformely formatted text. The text size tries to adjust to the block size.
The constructor should not be invoked directly but JBlocks#newBlock or JBlocks#addNewBlock should be used instead.
Method Detail
-
init(layout, options)Initializes a Text block. The method is invoked by the jBlocks core and must never be called directly.
- Parameters:
- {Object} layout Optional
- see Block#init.
- {Object} options Optional
- in addition to base class options Block#init:
- {String} options.text Optional, Default: ""
- the text to be displayed.
- {Boolean} options.multiline Optional, Default: false
- should this text be displayed on a single or several lines.
- {String} options.containerTag Optional, Default: "p"
- the HTML tag enclosing the text.
- {Number} options.emRatio Optional, Default: 0.7
- the ratio to be used to adjust the font size when in multiline mode.
-
textVal(text)Get or set the block text.
- Parameters:
- {String} text Optional
- if an argument is used, it replaces the text currently being displayed.
- Returns:
- the text contained in the block.