maxHeight.js 672 B

12345678910111213141516171819202122
  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', function () {
  11. return {
  12. restrict: 'A',
  13. link(scope, element, attrs) {
  14. return scope.$watch(attrs.maxHeight, function (value) {
  15. if (value != null) {
  16. return element.css({ 'max-height': value })
  17. }
  18. })
  19. },
  20. }
  21. })