Created
December 13, 2018 15:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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