maxHeight.js 656 B

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