1
0

scroll-view.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. (function() {
  2. var ScrollView, View,
  3. __hasProp = {}.hasOwnProperty,
  4. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
  5. View = require('space-pen').View;
  6. module.exports = ScrollView = (function(_super) {
  7. __extends(ScrollView, _super);
  8. function ScrollView() {
  9. return ScrollView.__super__.constructor.apply(this, arguments);
  10. }
  11. ScrollView.prototype.initialize = function() {
  12. return atom.commands.add(this.element, {
  13. 'core:move-up': (function(_this) {
  14. return function() {
  15. return _this.scrollUp();
  16. };
  17. })(this),
  18. 'core:move-down': (function(_this) {
  19. return function() {
  20. return _this.scrollDown();
  21. };
  22. })(this),
  23. 'core:page-up': (function(_this) {
  24. return function() {
  25. return _this.pageUp();
  26. };
  27. })(this),
  28. 'core:page-down': (function(_this) {
  29. return function() {
  30. return _this.pageDown();
  31. };
  32. })(this),
  33. 'core:move-to-top': (function(_this) {
  34. return function() {
  35. return _this.scrollToTop();
  36. };
  37. })(this),
  38. 'core:move-to-bottom': (function(_this) {
  39. return function() {
  40. return _this.scrollToBottom();
  41. };
  42. })(this)
  43. });
  44. };
  45. return ScrollView;
  46. })(View);
  47. }).call(this);