1

I am using the simpledialog module with the 'edit' tab still in it. The edit overlay for the node is displayed in the background with the simpledialog still in the way.

I have tried a bunch of ways of attaching the close call to the edit button and triggering a click on the dialog close button. None of it very successfully - all iframes. e.g.

$htj2('.tabs.primary').delegate('click', 'a', function() {
    $hjt2('#simple-dialog-container').dialog("close");

I think the 'correct drupal pattern' is to attach a behavior to the form load using drupal behaviors.

(function ($) {
    Drupal.bahaviors.hotTopicsResearch = {
        attach: function(context, settings) {
            // ?? What next?
            $('#hot-topic-research-node-form',context).once('load', function() {

            });
        }
    }
})(jQuery);

How do I find out what the behaviours are? How do I attach to the load event or is there an event related to clicking on the 'edit' tab? How do I get close the simpledialog?

  • it seems like your trying to react to the wrong thing in JS. I assume you're reffering to like this page: drupal.org/node/1087026. You want to hide the simpledialog if you press Edit on a node page -- before the Overlay pops up. You would do that by attaching a simple JS event listener to look for something like $('a[href~=edit]').clicked() ... and then simply call simpledialog close or $('#simplediaglo').hide(). my point, I think your attacking it from the wrong direction with the code you've provided – tenken Mar 1 '13 at 3:47
0

Got it after a number of days searching:

(function ($) {
    Drupal.behaviors.hotTopicsResearch = {
        attach: function(context, settings) {

            $(document).bind('drupalOverlayBeforeLoad', function(event) {
                $('#simple-dialog-container', context).dialog('close');
            });
        },
        weight: 11
    }

})(jQuery);

The other events seem to have the wrong order. 'drupalOverlayOpen' almost works except that the editing overlay never 'becomes active'. This is why I was trying to work on the target editing screen events rather than the open dialog.

overlay_paths without there being'use case documentation' it looks like it only applies to menu items. How to manually use Drupal 7's admin Overlay? shows you how to add content nodes to the admin paths. This displayed my node in the admin overlay, but without the background context being visible - defeating the point - and with some further quirks.

| improve this answer | |
  • I have exactly same problem and I'm not getting it solved :( I've tried the code you posted but the problem stays. Did you made any improvements after posting your code? – Елин Й. May 23 '14 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.