1 | import { __extends } from "tslib";
|
2 | import { getElements } from '../util';
|
3 | import { clearHighlight, setHighlightBy } from './highlight-util';
|
4 | import ElementSingleState from './single-state';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | var ElementSingleHighlight = (function (_super) {
|
10 | __extends(ElementSingleHighlight, _super);
|
11 | function ElementSingleHighlight() {
|
12 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
13 | _this.stateName = 'active';
|
14 | return _this;
|
15 | }
|
16 | |
17 |
|
18 |
|
19 | ElementSingleHighlight.prototype.highlight = function () {
|
20 | this.setState();
|
21 | };
|
22 | ElementSingleHighlight.prototype.setElementState = function (element, enable) {
|
23 | var view = this.context.view;
|
24 | var elements = getElements(view);
|
25 | setHighlightBy(elements, function (el) { return element === el; }, enable);
|
26 | };
|
27 |
|
28 | ElementSingleHighlight.prototype.clear = function () {
|
29 | var view = this.context.view;
|
30 | clearHighlight(view);
|
31 | };
|
32 | return ElementSingleHighlight;
|
33 | }(ElementSingleState));
|
34 | export default ElementSingleHighlight;
|
35 |
|
\ | No newline at end of file |