src/editor.js
function _saveStyleState(el, type, styles) {
    var returnState = {}
      , style;
    if (type === 'save') {
      for (style in styles) {
        if (styles.hasOwnProperty(style)) {
          returnState[style] = _getStyle(el, style);
        }
      }
      // After it's all done saving all the previous states, change the styles
      _applyStyles(el, styles);
    }
    else if (type === 'apply') {
      _applyStyles(el, styles);
    }
    return returnState;
  }
function _saveStyleState(el, type, styles) {
    var returnState = {}
      , style;
    if (type === 'save') {
      for (style in styles) {
        if (styles.hasOwnProperty(style)) {
          returnState[style] = _getStyle(el, style);
        }
      }
      // After it's all done saving all the previous states, change the styles
      _applyStyles(el, styles);
    }
    else if (type === 'apply') {
      _applyStyles(el, styles);
    }
    return returnState;
  }
function _saveStyleState ( el , type , styles ) { var returnState = { } , style ; if ( type === 'save' ) { for ( style in styles ) { if ( styles . hasOwnProperty ( style ) ) { returnState [ style ] = _getStyle ( el , style ) ; } } // After it's all done saving all the previous states, change the styles _applyStyles ( el , styles ) ; } else if ( type === 'apply' ) { _applyStyles ( el , styles ) ; } return returnState ; }
Saves the current style state for the styles requested, then applies styles
to overwrite the existing one. The old styles are returned as an object so
you can pass it back in when you want to revert back to the old style
@param   {object} el     The element to get the styles of
@param   {string} type   Can be "save" or "apply". apply will just apply styles you give it. Save will write styles
@param   {object} styles Key/value style/property pairs
@returns {object}
Saves the current style state for the styles requested then applies styles to overwrite the existing one . The old styles are returned as an object so you can pass it back in when you want to revert back to the old style