Friday, 15 January 2010

expressionengine - safecracker matrix-menu doesn't appear in overlay -



expressionengine - safecracker matrix-menu doesn't appear in overlay -

i have site, not visible public, utilize safecracker , matrix fields in several locations. on pages load normally, fine. when matrix fields appear in overlay (using colorbox), matrix-menu div isn't created.

stepping through code firebug, issue seems line:

var $body = $(document.body);

doesn't set $body correctly (maybe race status overlay loading?). when gets chunk of code in matrix.js:

obj.menu.$ul = $('<ul id="matrix-menu" />').appendto($body).css({ opacity: 0, display: 'none' });

$body doesn't resolve, menu can't attache anywhere. think i've fixed it, want check , see if should worried i'll break else. if alter above code to:

obj.menu.$ul = $('<ul id="matrix-menu" />').appendto($(document.body)).css({ opacity: 0, display: 'none' });

everything seems fine. there improve way address this?

if matrix field doesn’t have height when first initialized, puts of initialization stuff on hold, assuming it’s either hidden default or lives on secondary publish tab. cuts downwards on initial page load time , fixes issues celltypes (text, assets, maybe others.) need know dimensions of dom elements within cells.

matrix automatically resume initialization when has been expanded or tab has been clicked on, if you’re using matrix outside of publish page and hiding it, you’ll need trigger initialization-resuming yourself:

for (var = 0; < matrix.instances; i++) { matrix.instances[i].initrowsifvisible(); }

expressionengine

No comments:

Post a Comment