maxHeight.js 673 B

12345678910111213141516171819202122
  1. /* eslint-disable
  2. no-undef,
  3. */
  4. // TODO: This file was created by bulk-decaffeinate.
  5. // Fix any style issues and re-enable lint.
  6. /*
  7. * decaffeinate suggestions:
  8. * DS102: Remove unnecessary code created because of implicit returns
  9. * DS207: Consider shorter variations of null checks
  10. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  11. */
  12. define(['base'], App =>
  13. App.directive('maxHeight', () => ({
  14. restrict: 'A',
  15. link(scope, element, attrs) {
  16. return scope.$watch(attrs.maxHeight, function(value) {
  17. if (value != null) {
  18. return element.css({ 'max-height': value })
  19. }
  20. })
  21. }
  22. })))