(function ($) {
    $.field_categories = function (element, options) {
        var defaults = {
        }
        var plugin = this;
        plugin.settings = {}
        var $element = $(element),
            element = element;

        plugin.init = function () {
            plugin.settings = $.extend({}, defaults, options);
            $element.find('select.list-category').select2();
        };
        plugin.example_function = function () {
        };
        plugin.init();
    }

    $.fn.field_categories = function (options) {

        return this.each(function () {

            if (undefined == $(this).data('field_categories')) {
                var plugin = new $.field_categories(this, options);
                $(this).data('field_categories', plugin);
            }
        });
    }
})(jQuery);