(function () {
    // standalone components will have their own knockout bindings. Use
    // standalone: false if you want to mix the component into another model
    var components = {
        'inline-edit': {path: 'hqwebapp/js/components/inline_edit', standalone: true},
        'pagination': {path: 'hqwebapp/js/components/pagination', standalone: false},
    };

    _.each(components, function(module, elementName) {
        ko.components.register(elementName, hqImport(module.path));
    });

    $(function() {
        _.each(components, function(module, elementName) {
            if (module.standalone){
                _.each($(elementName), function(el) {
                    var $el = $(el);
                    if (!$el.closest('.ko-template').length) {
                        $(el).koApplyBindings();
                    }
                });
            }
        });
    });
}());

(function () {
    var components = {
        'inline-edit': 'hqwebapp/js/components/inline_edit',
        'pagination': 'hqwebapp/js/components/pagination'
    };

    _.each(components, function(moduleName, elementName) {
        ko.components.register(elementName, hqImport(moduleName));
    });

    $(function() {
        _.each(_.keys(components), function(elementName) {
            _.each($(elementName), function(el) {
                var $el = $(el);
                if (!$el.closest('.ko-template').length) {
                    $(el).koApplyBindings();
                }
            });
        });
    });
}());

Revert "Only apply bindings to standalone components"
Revert "Only apply bindings to standalone components"

This reverts commit 6a91688cb6559c995b5c9390834f9bfb6ef91e63.
