module.exports = {
    touchStart: function (event, ownerInstance) {
        var instance = event.instance;
        var dataSet = instance.getDataset();
        var disabled = dataSet.disabled;
        var loading = dataSet.loading;

        if (instance && !disabled && !loading) {
            instance.addClass('active');
        }
    },

    touchEnd: function (event, ownerInstance) {
        var instance = event.instance;
        var dataSet = instance.getDataset();
        var disabled = dataSet.disabled;
        var loading = dataSet.loading;

        if (instance && !disabled && !loading) {
            instance.removeClass('active');
        }
    },

    getIconColor: function (iconColor, type, plain, disabled) {
        if (type === 'primary') {
            return disabled ? '#CCCCCC' : '#141414';
        }
        if (type === 'white' && !plain) {
            return disabled ? 'rgba(34, 36, 37, 0.5)' : 'rgba(34, 36, 37, 0.9)';
        }
        return iconColor;
    },
};
