/**
 * addClass.js
 *
 * @Author: apple
 * @Date: 2018/4/13 21:57
 */

var addClass = function addClass(element, className) {
    if (element) {
        var originCls = element.className;
        if (!originCls.match(className)) {
            originCls += " " + className;
        }
        element.className = originCls;
    }
};

var deleteClass = function deleteClass(element, className) {
    if (element) {
        var originCls = element.className;
        if (originCls.match(className)) {
            originCls = originCls.split(" " + className)[0];
        }
        element.className = originCls;
    }
};

export { addClass, deleteClass };