forked from openlayers/openlayers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobservable.js
32 lines (32 loc) · 949 Bytes
/
observable.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var util = require('util');
exports.defineTags = function(dictionary) {
dictionary.defineTag('observable', {
mustHaveValue: true,
canHaveType: true,
canHaveName: true,
onTagged: function(doclet, tag) {
if (!doclet.observables) {
doclet.observables = [];
}
var description = tag.value.description;
var readonly = description.split(' ').shift() === 'readonly';
if (readonly) {
description = description.split(' ').slice(1).join(' ');
}
doclet.observables.push({
name: tag.value.name,
type: {
names: tag.value.type.names
},
description: description,
readonly: readonly
});
if (!doclet.fires) {
doclet.fires = [];
}
if (doclet.fires.indexOf('{@link ol.ObjectEvent} ol.event:ObjectEvent') === -1) {
doclet.fires.push('{@link ol.ObjectEvent} ol.event:ObjectEvent');
}
}
});
};