Trying to grasp the concept of this mod and if it will support "firing off" a new popup, as opposed to popup-enabling a link.

I'd like my module to display a node (nid specificed in code) via a popup without user intervention. Is this possible?

Comments

dlumberg’s picture

I just did this to bind to a checkbox, here is a rough example to fire the jQuery for the Popups API with a binding to an onClick to an id.
I'm sure somebody could make this prettier.

/* example.js */

/**
 * Attach the behavior.
 */
Drupal.behaviors.ExamplePopup = function(context) {
  
/* Using ID for selector */
  $("#edit-field-id").click(function(){
  
/* Since we're bypassing the popups api we need to get the element manually */
  var element = document.getElementById('edit-field-id');

/* Since we're bypassing the popups api we need to set the options manually */
  var options = new Array();
    options.SetOptionsHere = Options;

/* Fire the event */
  Drupal.popups.openPath(element, options);

  )};
};
Todd Young’s picture

Hmm. That looks helpful, thanks. I have an experience gap to overcome in order to connect the answer to the question though, I will give it a whirl.