Block Display + JS + Paste From Scrapbook

Permalink
Perhaps I'm missing something, but consider the following..

A block requires some JS to be loaded in the document head in order to render properly. No problem, just use...

$this->addHeaderItem()

...from the on_page_view() method in the block's controller. Everything's peachy. The block displays as it should on any page- even the dashboard's global scrapbook page.

However, it DOES NOT display properly in the "Paste From Scrapbook" dialog. Why? Because the on_page_view() method is not invoked in that context, so the JS file never gets loaded into the document head.

So my question is, what's the proper way to get a block to render within the "Paste From Scrapbook" dialog if it relies on an external JS file???

Since that dialog's contents are retrieved via AJAX, it seems to me that perhaps ccm_addHeaderItem() should be invoked somewhere in the process. Is this a bug, or am I just overlooking something?

Thanks for the help!

-Steve

Shotster
 
Mnkras replied on at Permalink Reply
Mnkras
auto loaded Block and package js is loaded differently than hardcoded js, i found this when working on the minify, there is a bug for this,
Shotster replied on at Permalink Reply
Shotster
Can you point me to the bug report? I searched and couldn't find it. I'd like to see if it's the same issue I've encountered.

I've distilled my issue down to the following...

JS added via addHeaderItem() from a block's controller is not output when the block is displayed in the "Paste From Scrapbook" dialog.

-Steve