colorbox_inline.js 644 B

1234567891011121314151617181920212223
  1. (function ($) {
  2. "use strict";
  3. /**
  4. * Enable the colorbox inline functionality.
  5. */
  6. Drupal.behaviors.colorboxInline = {
  7. attach: function (context, drupalSettings) {
  8. $('[data-colorbox-inline]', context).once().click(function () {
  9. var $link = $(this);
  10. var settings = $.extend({}, drupalSettings.colorbox, {
  11. href: false,
  12. inline: true
  13. }, {
  14. className: $link.data('class'),
  15. href: $link.data('colorbox-inline'),
  16. width: $link.data('width'),
  17. height: $link.data('height')
  18. });
  19. $link.colorbox(settings);
  20. });
  21. }
  22. };
  23. })(jQuery);