demos/Collage/fabric.js
function addClass(element, className) {
    if ((' ' + element.className + ' ').indexOf(' ' + className + ' ') === -1) {
      element.className += (element.className ? ' ' : '') + className;
    }  
  }
function addClass(element, className) {
    if ((' ' + element.className + ' ').indexOf(' ' + className + ' ') === -1) {
      element.className += (element.className ? ' ' : '') + className;
    }  
  }
function addClass ( element , className ) { if ( ( ' ' + element . className + ' ' ) . indexOf ( ' ' + className + ' ' ) === - 1 ) { element . className += ( element . className ? ' ' : '' ) + className ; } }
Adds class to an element
@method addClass
@memberOf fabric.util
@param {HTMLElement} element Element to add class to
@param {String} className Class to add to an element
Adds class to an element