PdfViewToggleController.js 912 B

12345678910111213141516171819202122232425262728293031
  1. /* eslint-disable
  2. no-return-assign,
  3. no-undef,
  4. */
  5. // TODO: This file was created by bulk-decaffeinate.
  6. // Fix any style issues and re-enable lint.
  7. /*
  8. * decaffeinate suggestions:
  9. * DS102: Remove unnecessary code created because of implicit returns
  10. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  11. */
  12. define(['../../../base'], App =>
  13. App.controller('PdfViewToggleController', function($scope) {
  14. $scope.togglePdfView = function() {
  15. if ($scope.ui.view === 'pdf') {
  16. return ($scope.ui.view = 'editor')
  17. } else {
  18. return ($scope.ui.view = 'pdf')
  19. }
  20. }
  21. $scope.fileTreeClosed = false
  22. return $scope.$on('layout:main:resize', function(e, state) {
  23. if (state.west.initClosed) {
  24. $scope.fileTreeClosed = true
  25. } else {
  26. $scope.fileTreeClosed = false
  27. }
  28. return $scope.$apply()
  29. })
  30. }))