Extends
Members
auto :boolean
- Description:
- The auto attribute of this fragment, toggles automatic behaviour on/off
- Source:
- Overrides:
The auto attribute of this fragment, toggles automatic behaviour on/off
Type:
raw :string
- Description:
- The raw representation of this fragment, can be used to set/get the raw value.
- Source:
- Overrides:
The raw representation of this fragment, can be used to set/get the raw value.
Type:
Examples
//Get the raw value of a fragment
let fragmentValue = myFragment.raw;
//Set the raw value of a fragment
myFragment.raw = myNewFragmentValue;
(readonly) type :string
- Description:
- The type of this fragment
- Source:
- Overrides:
The type of this fragment
Type:
Methods
getDomPath()
- Description:
- Returns a dompath for finding this fragment
- Source:
- Overrides:
registerOnAutoChangedHandler(callback)
- Description:
- Register a callback to run when auto attribute changes on fragment
- Source:
- Overrides:
Example
Fragment.one("#myFragment").registerOnAutoChangedHandler((fragment, auto)=>{
//Fragment auto attribute changed
});
Parameters:
registerOnClassChangedHandler(callback)
- Description:
- Register a callback to run when the classes of this fragment changes
- Source:
- Overrides:
Example
Fragment.one("#myFragment").registerOnClassChangedHandler((classes)=>{
//Some classes changed on this fragment
});
Parameters:
registerOnFragmentChangedHandler(callback)
- Description:
- Register a callback to be run when this fragments content changes.
- Source:
- Overrides:
Example
Fragment.one("#myFragment").registerOnFragmentChangedHandler((context)=>{
//Fragment has changed
});
Parameters:
registerOnFragmentUnloadedHandler(callback)
- Description:
- Register a callback to run when this fragment is unloaded
- Source:
- Overrides:
Example
Fragment.one("#myFragment").registerOnFragmentUnloadedHandler(()=>{
//Fragment is unloaded
});
Parameters:
registerOnTextDeletedHandler(callback)
- Description:
- Register a callback to run when text is deleted from this fragment
- Source:
- Overrides:
Example
Fragment.one("#myFragment").registerOnTextDeletedHandler((position, value)=>{
//Text "value" has been deleted from this fragment at "position"
});
Parameters:
registerOnTextInsertedHandler(callback)
- Description:
- Register a callback to run when text is inserted into this fragment
- Source:
- Overrides:
Example
Fragment.one("#myFragment").registerOnTextInsertedHandler((position, value)=>{
//Text "value" has been inserted into this fragment at "position"
});
Parameters:
require() → {Promise.<HTMLStyleElement>}
- Description:
- Create a style element containing the css rules resulting from compiling this fragments scss
- Source:
- Overrides:
Example
let styleElm = Fragment.one("#myScssFragment").require();
Returns:
-
Type
-
Promise.<HTMLStyleElement>
unRegisterOnAutoChangedHandler(callback)
- Description:
- Unregister a callback handler
- Source:
- Overrides:
Parameters:
unRegisterOnFragmentChangedHandler(callback)
- Description:
- Unregister a callback handler
- Source:
- Overrides:
Parameters:
unRegisterOnFragmentUnloadedHandler(callback)
- Description:
- Unregister a callback handler
- Source:
- Overrides:
Parameters:
unload()
- Description:
- Tell this fragment to unload itself
- Source:
- Overrides:
Example
Fragment.one("#myFragment").unload();