Web Component: j-Parts
j-Parts
This content can handle multiple parts
stored in the Array
and focus on one specific part. It simulates something like browser tabs.
- jComponent
v19|v20
Configuration:
parent
{String}
parent area due to part size (default:auto
)margin
{Number}
vertical margin (default:0
)create
{String}
a link to thefunction(part)
, it's executed if the part is created (called once)focus
{String}
a link to thefunction(part)
, it's executed if the part is focusedclose
{String}
a link to thefunction(part)
, it's executed if the part is closed
Good to know 1:
- all
~PATH~
phrases will be replaced byitem.path
automatically - all
~ID~
phrases will be replaced byitem.id
automatically
Item specification:
item.id
{String}
very important, part identifieritem.blur
{String/Function(el, item)}
optional, a link to thefunction(element, item)
if the part is focused outitem.focus
{String/Function(el, item)}
oritem.reload
{String}
optional, a link to thefunction(element, item)
if the part is focuseditem.remove
{String/Function(el, item)}
optional, a link to thefunction(element, item)
if the part is removeditem.html
{String}
a HTML content or useitem.url
item.import
{String}
URL address for the part contentitem.path
{String}
optional, it replaces all~PATH~
phrases automaticallyitem.delay
{Number}
a delay for removing ofinvisible
class- NEW
item.attrd
{Object}
addsdata-key
attributes into the item element
Extendend by the component:
item.focused
{Boolean}
determines if the part is focused or notitem.element
{jQuery}
part element
Methods:
component.close(id)
closes partcomponent.focus(id)
focuses partcomponent.rename(id, name, [icon])
renames part
Created
12. february 2022
Updated
20. february 2024
jComponent library
19 | 20
Version
v1
License
https://www.totaljs.com/license/
Responsive
Yes
Author
Peter Širka
Email
petersirka@gmail.com