Skip to content

Trigger reorient with parameters #2

@mrfatguy

Description

@mrfatguy

Why you're forcing user to react on changing classes on body? What about, if these classes are already used by other solution or piece of code?

Wouldn't it be easier and more generic to change:

$(window).trigger('reorient');

to:

$(window).trigger('reorient', [orient]);

This way, if someone does want to have classes, he/she can set them to body manually. And if someone else want to know current orientation directly in event (for example to be used in some JS code), then he/she is also satisfied by this modification. While with your original code, second is not possible, without checking for body class changes in reorient event. Which -- as I said -- will eventually fall at all if some other piece of code is using the same classes or modifies body in some way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions