Skip to content

Convert copy_as_gfm into ES module and move to behaviors

Mike Greiling requested to merge es-module-copy_as_gfm into master

What does this MR do?

copy_as_gfm is initialized on every page load and should be grouped with our other "behavior" modules.

  • moves copy_as_gfm.js to ./behaviors/copy_as_gfm.js and removes import statement from main.js
  • removes window.gl.CopyAsGFM global export in favor of ES module import/export syntax
  • ensures tests still have direct access to the class

There is really no reason for CopyAsGFM to be a class in the first place, since all of its methods are static. However that optimization is out of the scope of this MR.

related: gitlab-org/gitlab-ce#38869

Merge request reports