Open nesjett opened 4 years ago
Maybe here's an answer found ? #1259
Thank you @tgtje but this is the same info that appears in the developer manual, but no example or notice about using context.
@lonalore knows most about this part of e107 :)
e107 core will call attached behaviors when the DOM (the object representation of the HTML) is fully loaded, passing in two arguments:
You can find many exampe usages here: https://github.com/e107inc/e107/blob/master/e107_web/js/core/all.jquery.js
For example:
/**
* Behavior to hide elements.
*
* @type {{attach: e107.behaviors.eHideMe.attach}}
*/
e107.behaviors.eHideMe = {
attach: function (context, settings)
{
$(context).find('.e-hideme').once('e-hide-me').each(function ()
{
$(this).hide();
});
}
};
I'm trying to use contexts but I can't find any example of ussage, only about settings but not context.
Someone can add some light on this?
Thank you