Noosfero/noosfero

View on GitHub
plugins/require_auth_to_comment/public/comment_require_login.js

Summary

Maintainability
A
0 mins
Test Coverage
(function($) {
  $(window).bind('userDataLoaded', function(event, data) {
    if (!data.login && $('meta[name="profile.allow_unauthenticated_comments"]').length <= 0) {
      $('.display-comment-form').unbind();
      $('.display-comment-form').addClass('require-login-popup');
    }
  });
})(jQuery);