EditorToolbarController.js 646 B

1234567891011121314151617181920212223
  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', [
  6. '$scope',
  7. 'ide',
  8. function ($scope, ide) {
  9. const editorButtons = []
  10. for (const editorToolbarButton of editorToolbarButtons) {
  11. const button = editorToolbarButton.button($scope, ide)
  12. if (editorToolbarButton.source) {
  13. editorButtons.push(button)
  14. }
  15. }
  16. $scope.editorButtons = editorButtons
  17. },
  18. ])