1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | "use strict";
|
8 | var __extends = (this && this.__extends) || (function () {
|
9 | var extendStatics = Object.setPrototypeOf ||
|
10 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
11 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
12 | return function (d, b) {
|
13 | extendStatics(d, b);
|
14 | function __() { this.constructor = d; }
|
15 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
16 | };
|
17 | })();
|
18 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
19 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
21 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
22 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
23 | };
|
24 | var __metadata = (this && this.__metadata) || function (k, v) {
|
25 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
26 | };
|
27 | Object.defineProperty(exports, "__esModule", { value: true });
|
28 | var beanStub_1 = require("../context/beanStub");
|
29 | var context_1 = require("../context/context");
|
30 | var columnHoverService_1 = require("../rendering/columnHoverService");
|
31 | var HoverFeature = (function (_super) {
|
32 | __extends(HoverFeature, _super);
|
33 | function HoverFeature(columns, element) {
|
34 | var _this = _super.call(this) || this;
|
35 | _this.columns = columns;
|
36 | _this.addMouseHoverListeners(element);
|
37 | return _this;
|
38 | }
|
39 | HoverFeature.prototype.addMouseHoverListeners = function (element) {
|
40 | this.addDestroyableEventListener(element, 'mouseout', this.onMouseOut.bind(this));
|
41 | this.addDestroyableEventListener(element, 'mouseover', this.onMouseOver.bind(this));
|
42 | };
|
43 | HoverFeature.prototype.onMouseOut = function () {
|
44 | this.columnHoverService.clearMouseOver();
|
45 | };
|
46 | HoverFeature.prototype.onMouseOver = function () {
|
47 | this.columnHoverService.setMouseOver(this.columns);
|
48 | };
|
49 | __decorate([
|
50 | context_1.Autowired('columnHoverService'),
|
51 | __metadata("design:type", columnHoverService_1.ColumnHoverService)
|
52 | ], HoverFeature.prototype, "columnHoverService", void 0);
|
53 | return HoverFeature;
|
54 | }(beanStub_1.BeanStub));
|
55 | exports.HoverFeature = HoverFeature;
|