EN RU
Forum

Methodology

Technology

Toolbox

Libraries

Tutorials

DocumentationJSDocSource

i-bem-dom

A helper block for creating other blocks that have a DOM representation.

The block is implemented as a specialized JavaScript framework for web development using the BEM methodology.

There is a separate document with a detailed user's guide.

Instance methods:
on
once
un
Object methods:
EventManagerFactory
Class EventManagerFactory
Instance methods:
getEventManager
Object methods:
EventManagerFactory
emit
Class EventManagerFactory
Instance methods:
_createEventManager
Object methods:
EventManagerFactory
Class EventManagerFactory
Instance methods:
_createEventManager

Module i-bem-dom

Object methods:

Block()
description
Base class for creating BEM blocks that have DOM representation
Elem()
description
Base class for creating BEM elements that have DOM representation
scope()
description
Scope
doc()
description
Document shortcut
win()
description
Window shortcut
Block()
description
Base bemDom block
Elem()
description
Base bemDom element
isEntity(entity):Boolean
parameters
entity
*
declBlock(blockName, [base], [props], [staticProps]):Function
description
Declares DOM-based block and creates block class
parameters
blockName
String, Function
Block name or block class
base
Function, [object Object]
base block + mixes
props
Object
Methods
staticProps
Object
Static methods
declElem(blockName, elemName, [base], [props], [staticProps]):Function
description
Declares elem and creates elem class
parameters
blockName
String
Block name
elemName
String
Elem name
base
Function, [object Object]
base elem + mixes
props
Object
Methods
staticProps
Object
Static methods
init([ctx]):jQuery
description
Initializes blocks on a fragment of the DOM tree
parameters
ctx
jQuery, String
Root DOM node
destruct(ctx, [excludeSelf])
description
Destroys blocks on a fragment of the DOM tree
parameters
ctx
jQuery
Root DOM node
excludeSelf
Boolean
Exclude the main domElem
detach(ctx, [excludeSelf])
description
Detaches blocks on a fragment of the DOM tree without DOM tree destruction
parameters
ctx
jQuery
Root DOM node
excludeSelf
Boolean
Exclude the main domElem
update(ctx, content):jQuery
description
Replaces a fragment of the DOM tree inside the context, destroying old blocks and intializing new ones
parameters
ctx
jQuery
Root DOM node
content
jQuery, String
New content
replace(ctx, content):jQuery
description
Changes a fragment of the DOM tree including the context and initializes blocks.
parameters
ctx
jQuery
Root DOM node
content
jQuery, String
Content to be added
append(ctx, content):jQuery
description
Adds a fragment of the DOM tree at the end of the context and initializes blocks
parameters
ctx
jQuery
Root DOM node
content
jQuery, String
Content to be added
prepend(ctx, content):jQuery
description
Adds a fragment of the DOM tree at the beginning of the context and initializes blocks
parameters
ctx
jQuery
Root DOM node
content
jQuery, String
Content to be added
before(ctx, content):jQuery
description
Adds a fragment of the DOM tree before the context and initializes blocks
parameters
ctx
jQuery
Contextual DOM node
content
jQuery, String
Content to be added
after(ctx, content):jQuery
description
Adds a fragment of the DOM tree after the context and initializes blocks
parameters
ctx
jQuery
Contextual DOM node
content
jQuery, String
Content to be added

Class Block

Instance methods:

_block()override

Class Elem

Instance methods:

_block()override

i-bem-dom__events

Instance methods:

on(e, [data], fn):EventManager
description
Adds an event handler
parameters
e
String, Object, events:Event
Event type
data
*
Additional data that the handler gets as e.data
fn
Function
Handler
once(e, [data], fn):EventManager
description
Adds an event handler
parameters
e
String
Event type
data
*
Additional data that the handler gets as e.data
fn
Function
Handler
un([e], [fn]):EventManager
description
Removes event handler or handlers
parameters
e
String, Object, events:Event
Event type
fn
Function
Handler

Object methods:

EventManagerFactory()

Class EventManagerFactory

Instance methods:

getEventManager(ctx, bindCtx, bindScope):EventManager
description
Instantiates event manager
parameters
ctx
Function, i-bem-dom:BemDomEntity
BemDomEntity class or instance
bindCtx
*
context to bind
bindScope
jQuery
bind scope

i-bem-dom__init

Initializes blocks on a fragment of the DOM tree
parameters
ctx
jQuery
Root DOM node
returns
jQuery
ctx Initialization context

i-bem-dom__events_type_bem

Object methods:

EventManagerFactory()
emit(ctx, e, [data])
description
Emits BEM event
parameters
ctx
BemDomEntity
e
String, Object, events:Event
Event name
data
Object

Class EventManagerFactory

Instance methods:

_createEventManager()override

i-bem-dom__events_type_dom

Object methods:

EventManagerFactory()

Class EventManagerFactory

Instance methods:

_createEventManager()override