Repository navigation
Metaboxes: Hold jQuery ready only if there are metaboxes - #3476
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3476 +/- ##
=========================================
- Coverage 34.24% 34.2% -0.05%
=========================================
Files 257 257
Lines 6739 6744 +5
Branches 1222 1223 +1
=========================================
- Hits 2308 2307 -1
- Misses 3740 3745 +5
- Partials 691 692 +1
Continue to review full report at Codecov.
|
aduth
left a comment
There was a problem hiding this comment.
Finding this to be another case where refx would be better suited to fire effects after the original action occurs. As implemented here, it means we could create a selector to reuse between META_BOX_LOADED and INITIALIZE_META_BOX_STATE to find getUnloadedMetaBoxes to determine if there is anything pending load.
I still don't really understand the purpose of holdReady, but if we're assuming it should be holding so long as there are unloaded meta boxes, then I agree with the change that it should only hold in the first place if there are meta boxes.
There was a problem hiding this comment.
Do we need to account for action.metaBoxes.advanced ? I guess we're not showing these?
Otherwise this could work well:
if ( some( action.metaBoxes ) ) {There was a problem hiding this comment.
I found that "advanced" and "normal" are the showing the same metaboxes somehow. We're still not showing the metaboxes supposed to appear under the title but I'm not sure how these are registered.
95aa65a to
812d62d
Compare
closes #3465
We hold jQuery ready event when we have metaboxes still being loaded but this breaks the heartbeat script since we never trigger the "ready" event if we do not have metaboxes.
This PR fixes the issue by holding the "ready" event only if we have metaboxes.