colorbox icon indicating copy to clipboard operation
colorbox copied to clipboard

AMD support

Open tigusigalpa opened this issue 8 years ago • 1 comments

Hi, Jack! First of all - great plugin, thanks a lot for the one! I know about 3 years ago there was an issue about AMD compatible (#427), but i dont understand is it planing for now or not? Thanks!

tigusigalpa avatar Oct 09 '16 14:10 tigusigalpa

+1 from me. jquery loaded via AMD so theres no global jquery, and colorbox doesnt register.

Probably need a pullrequest. For the time being will have to add a UMD loader and load it locally.

Workaround is use (requirejs) config.shim to bring colorbox into 2018:

require.config = {
  "shim": {
    "colorbox": {
      "deps": ["jquery"],
      exports: "jQuery.fn.colorbox"
    }
  }

then you can write code:

require(['jquery','colorbox'], function($,colorbox) {
  $("#gallery").colorbox();
});

ericnewton76 avatar Apr 05 '18 20:04 ericnewton76