Skip to content

Commit f3d6395

Browse files
committed
Rename 'Blacklight' inside of core.js as 'Core'
When bundled into one file such as the 'blacklight.esm.js' this file produces, it was resulting in a conflict with top-level Blacklight module, and resulting in error 'Uncaught TypeError: Blacklight.activate is not a function'
1 parent 26651bf commit f3d6395

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/javascript/blacklight/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Blacklight = function() {
1+
const Core = function() {
22
const buffer = new Array;
33
return {
44
onLoad: function(func) {
@@ -34,13 +34,13 @@ const Blacklight = function() {
3434

3535
// turbolinks triggers page:load events on page transition
3636
// If app isn't using turbolinks, this event will never be triggered, no prob.
37-
Blacklight.listeners().forEach(function(listener) {
37+
Core.listeners().forEach(function(listener) {
3838
document.addEventListener(listener, function() {
39-
Blacklight.activate()
39+
Core.activate()
4040
})
4141
})
4242

43-
Blacklight.onLoad(function () {
43+
Core.onLoad(function () {
4444
const elem = document.querySelector('.no-js');
4545

4646
// The "no-js" class may already have been removed because this function is
@@ -52,4 +52,4 @@ Blacklight.onLoad(function () {
5252
})
5353

5454

55-
export default Blacklight
55+
export default Core

0 commit comments

Comments
 (0)