I use autmodal to make a simple modal node delete link in a view (<a href='/node/[nid]/delete' class='automodal'>Delete</a>).

In the resulting confirm form the 'delete' option works perfectly. The 'cancel' option opens a new browser window with the original parent page of the modal and leaves the modal box open and spinning in never never land in the other page.

any else seeing this?

Comments

jjemmett’s picture

I can confirm this also. The way we get around this is we hide the cancel link within automodals via css in the theme.

rv0’s picture

Same issue here.

A solution might be here:
http://drupal.org/node/788504#comment-3685266

however I havent gotten that to work, it should.
Maybe this could be incorporated into the module?

broncomania’s picture

Subscribe

ShadowMonster’s picture

Fast solution:

function mymodule_form_alter(&$form, &$form_state, $form_id) {

        if($form_id == 'node_delete_confirm') {
                $form['actions']['cancel']['#value'] = '<a class="button" href="" onclick="Drupal.modalFrameChild.triggerParentEvent(\'childClose\', false); return false;"><span>Cancel</span></a>';
                //print_r($form);
                
                }

}
hefox’s picture

Status: Active » Needs review
StatusFileSize
new14.95 KB

Patch removes the cancel when in modalframe popup (there's already an x in the corner to cancel).

Adding js to close means likely either regular expressioning it in, or adding some js that runs on child that closes it, or something: this was cleaner.

hefox’s picture

StatusFileSize
new764 bytes

Forgot --relative

dsnopek’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed in 8cf86ae. Thanks, @hefox!

Status: Fixed » Closed (fixed)

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