API Docs for:
Show:

Utils.Helpers Class

Various uncategorised helpers

Item Index

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

(
  • nodeName
  • attrs
)
Node

Creates new nodes and allows to set attributes, styles and data- attributes directly on creation

Parameters:

  • nodeName String

    Name of the node to create

  • attrs Object

    Key: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
    }
});