EditorToolbarController.js 594 B

12345678910111213141516171819
  1. import App from '../../base'
  2. import importOverleafModules from '../../../macros/import-overleaf-module.macro'
  3. const eModules = importOverleafModules('editorToolbarButtons')
  4. const editorToolbarButtons = eModules.map(item => item.import.default)
  5. export default App.controller('EditorToolbarController', ($scope, ide) => {
  6. const editorButtons = []
  7. for (const editorToolbarButton of editorToolbarButtons) {
  8. const button = editorToolbarButton.button($scope, ide)
  9. if (editorToolbarButton.source) {
  10. editorButtons.push(button)
  11. }
  12. }
  13. $scope.editorButtons = editorButtons
  14. })