diff --git a/modules/filter/filter.js b/modules/filter/filter.js index 94e01c1..11f558e 100644 --- a/modules/filter/filter.js +++ b/modules/filter/filter.js @@ -17,4 +17,31 @@ Drupal.behaviors.filterGuidelines = { } }; +/** + * Attach behaviors to the more help links within the filter tips. + */ +Drupal.behaviors.filterHelpLinks = { + attach: function (context) { + $('div.filter-help a', context).bind('click',Drupal.filter.openInNewWindow); + }, + detach: function (context){ + $('div.filter-help a', context).unbind('click', Drupal.filter.openInNewWindow); + } +}; + +/** + * Filter module utility functions. + */ +Drupal.filter = Drupal.filter || { + /** + * Open links to files within forms in a new window. + */ + openInNewWindow: function (event) { + $(this).attr('target', '_blank'); + var filterUrl = this.href + (this.href.match(/\?/) ? '&popup=1' : '?popup=1'); + window.open(filterUrl, 'filterTips', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=980,height=550'); + return false; + } +}; + })(jQuery);