scrollabletext.js 686 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * scrollabletext.js - scrollable text element for blessed
  3. * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License).
  4. * https://github.com/chjj/blessed
  5. */
  6. /**
  7. * Modules
  8. */
  9. var Node = require('./node');
  10. var ScrollableBox = require('./scrollablebox');
  11. /**
  12. * ScrollableText
  13. */
  14. function ScrollableText(options) {
  15. if (!(this instanceof Node)) {
  16. return new ScrollableText(options);
  17. }
  18. options = options || {};
  19. options.alwaysScroll = true;
  20. ScrollableBox.call(this, options);
  21. }
  22. ScrollableText.prototype.__proto__ = ScrollableBox.prototype;
  23. ScrollableText.prototype.type = 'scrollable-text';
  24. /**
  25. * Expose
  26. */
  27. module.exports = ScrollableText;