Utils.Helpers Class
Various uncategorised helpers
Item Index
Methods
Methods
getScrollBarSize
()
Number
Calculates the size of scrollbars in pixels and returns that
Returns:
Number:
Size of scrollbars in pixels
Example:
import {getScrollBarSize} from './utils/helpers';
getScrollBarSize(); // -> Integer
tag
(
Node
-
nodeName -
attrs
Creates new nodes and allows to set attributes, styles and data- attributes directly on creation
Parameters:
-
nodeNameStringName of the node to create
-
attrsObjectKey:value pairs to set as attributes or properties
Returns:
Node:
A node of the given type
Example:
import {tag} from './utils/helpers';
var div = tag('div', {
className: 'myclass-1 myclass-2',
innerHTML: 'This is the content of the div',
data: {
widget: 'MyWidget',
defer: 'true'
},
style: {
display: 'block',
position: 'absolute',
top: 0,
left: 0
zIndex: 100
}
});
