### Eclipse Workspace Patch 1.0 #P travel_site Index: sites/all/modules/popups/popups.js =================================================================== --- sites/all/modules/popups/popups.js (revision 48030) +++ sites/all/modules/popups/popups.js (working copy) @@ -50,6 +50,7 @@ Drupal.popups.attach(context, '.popups-form-reload', {reloadWhenDone: true}); // whole page reload. Drupal.popups.attach(context, '.popups-form-noupdate', {noUpdate: true}); // no reload at all. Drupal.popups.attach(context, '.popups-form-noreload', {noUpdate: true}); // Obsolete. + Drupal.popups.attach(context, '.popups-links-replace', {linksReplaceContent: true}); }; @@ -74,7 +75,7 @@ var element = this; // If element is inside of a #popup div, show alert and bail out. - if ($(element).parents('#popups').length) { + if ($(element).parents('#popups').length && !options.linksReplaceContent) { alert("Sorry, popup chaining is not supported (yet)."); return false; } @@ -365,7 +366,19 @@ * A DOM object containing the element that was clicked to initiate the popup. */ Drupal.popups.openContent = function(title, content, options, element) { - Drupal.popups.open(title, content, null, options.width); + + // if the popups contain links, optionally convert load them inside the popup + if (options.linksReplaceContent && $('#popups-body').size()) { + $('#popups-body').html(content); + } + else { + Drupal.popups.open(title, content, null, options.width); + } + + if (options.linksReplaceContent) { + $('a', '#popups-body').addClass('popups-links-replace'); + } + // Add behaviors to content in popups. // TODO: d-n-d: need to click to let go of selection. delete Drupal.behaviors.tableHeader; // Work-around for bug in tableheader.js (http://drupal.org/node/234377) @@ -387,6 +400,7 @@ Drupal.popups.message("Bad Response form submission"); } }); + }; Drupal.popups.beforeSend = function(xhr) {