Skip to content

jQuery & native DOM api inconsistency in adding and removing classes #7

Description

@matikucharski

In layout files, eg. enterLayout.js shoudn't be this lines:

Template.enterLayout.rendered = function() {
  $('body').get()[0].className = 'enterLayout-body';
};

something like:

Template.enterLayout.rendered = function() {
  getElementsByTagName('body').className = 'enterLayout-body';
};

or better (if we are using jQuery and want to remove later only .enterLayout-body class but not completely clear all classes on body)

Template.enterLayout.rendered = function() {
  $('body').addClass('enterLayout-body');
};

Template.enterLayout.destroyed = function() {
  $('body').removeClass('enterLayout-body');
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions