You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use foundation as-is in a react/redux app and would like to have a top/App level call to $(document).foundation() (or perhaps a new $(document).foundation('ifNew')) on componentDidUpdate (which means often). If the each/loop that does the plugin creation was async it would not matter how often it is called (??) and you can remove the warning for if ($el.data('zfPlugin')) and just return. I think this could solve several problems for SPAs.
In foundation.core there is:
// Localize the search to all elements inside elem, as well as elem itself, unless elem === document
var $elem = $(elem).find('[data-'+name+']').addBack('[data-'+name+']');
// For each plugin found, initialize it
$elem.each(function() {
var $el = $(this),
(Ideally, the find would look for '[data-zf-'+name+']')
One thing I forgot to include (assume this is probably a known issue) was that reInit does not work. foundation.core does not recorgnize jquery elements, that have already been set up with foundation() passsed in to the above iterate.
I am trying to use foundation as-is in a react/redux app and would like to have a top/App level call to
$(document).foundation()
(or perhaps a new$(document).foundation('ifNew')
) on componentDidUpdate (which means often). If the each/loop that does the plugin creation was async it would not matter how often it is called (??) and you can remove the warning forif ($el.data('zfPlugin'))
and just return. I think this could solve several problems for SPAs.In foundation.core there is:
(Ideally, the find would look for
'[data-zf-'+name+']'
)Perhaps something like:
The text was updated successfully, but these errors were encountered: