maxHeight.js 637 B

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