HTML map/area has very similar behavior to an anchor link, lets make it work like one for ctools modals.

Comments

litwol’s picture

Status: Active » Needs review
StatusFileSize
new615 bytes

I'm using this in prod and it works.

Admittedly i have to do a little manual work to make use of this:

// This line won't work for most people. i've modified theme_image_formatter to support
// passing #attribute to image and image_style themes.
$node->content['field_image'][0]['#item']['#attributes']['usemap'] = '#caption-area';
$node->content['field_image'][0]['#suffix'] = 
<map name="caption-area">
 <area class="ctools-use-modal" shape="rect" coords="50,365,456,401" href="'. url('ccw/nojs/node/add/node-form/' . $node->nid) . '"/>
</map>';

tim.plunkett’s picture

Category: task » feature
Status: Needs review » Needs work

Some parts of CTools are switching over to the use of .once() instead of manually doing -processed, maybe now is the time to switch this, it would make the code much easier to read.

Also, your patch is rolled against a/sites/all/modules/contrib/ctools/js/modal.js, that won't work.

merlinofchaos’s picture

Well it'll work but then I'll have to use patch -p5 or something :)

litwol’s picture

Status: Needs work » Needs review
StatusFileSize
new483 bytes

Rerolled from fresh checkout this time. previous patch was from my private project repo. sorry about that.

I agree about .once() rewrite. however i firmly believe it should be handled in a separate issue as to avoid highjacking original point of this patch.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Opened #1505432: Rewrite JS to use jQuery.once().
Thanks for talking sense into me.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks for this and the testing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.