Skip to content

Instantly share code, notes, and snippets.

@dingo-d
Created December 13, 2018 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dingo-d/0ad8d67f9b88e96d8ae8cc1c8c450784 to your computer and use it in GitHub Desktop.
Save dingo-d/0ad8d67f9b88e96d8ae8cc1c8c450784 to your computer and use it in GitHub Desktop.
Init file for the pointers. Pointers script is located here: https://gist.github.com/dingo-d/a83092146c1660383cb5c3483d71cdab
/* global pointerLocalization */
import Pointers from './pointers';
$(function() {
const pointers = new Pointers();
// Filter the current context pointers
const pointersInContext = Object.values(pointerLocalization.pointers)
.filter((pointer) => pointer.context === pointerLocalization.currentScreen);
// Sort the pointers in order
const pointersInOrder = pointersInContext.sort((a, b) => a.initialOrder - b.initialOrder);
const initPointers = pointersInOrder.reduce((array, pointer) => {
array[pointer.id] = pointer;
return array;
}, {});
pointers.initPointers(initPointers);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment