Allow custom events and do not collect events from methods
This commit is contained in:
@@ -29,15 +29,11 @@ exports.handlers = {
|
|||||||
event = doclet.fires[j].replace('event:', '');
|
event = doclet.fires[j].replace('event:', '');
|
||||||
if (events[event]) {
|
if (events[event]) {
|
||||||
fires.push.apply(fires, events[event]);
|
fires.push.apply(fires, events[event]);
|
||||||
|
} else {
|
||||||
|
fires.push(doclet.fires[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doclet.fires = fires;
|
doclet.fires = fires;
|
||||||
} else {
|
|
||||||
eventClass = classes[doclet.longname.split('#')[0]];
|
|
||||||
if (!eventClass.fires) {
|
|
||||||
eventClass.fires = [];
|
|
||||||
}
|
|
||||||
eventClass.fires.push.apply(eventClass.fires, doclet.fires);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,18 +57,27 @@ var self = this;
|
|||||||
<h5>Fires:</h5>
|
<h5>Fires:</h5>
|
||||||
<ul><?js fires.forEach(function(f) {
|
<ul><?js fires.forEach(function(f) {
|
||||||
var parts = f.split(/#?event:/);
|
var parts = f.split(/#?event:/);
|
||||||
|
var type = parts.pop();
|
||||||
|
var eventClassName = parts[0];
|
||||||
|
parts = type.split(' ');
|
||||||
|
type = parts.shift();
|
||||||
|
var description = parts.length ? parts.join(' ') : '';
|
||||||
|
var eventDoclet = self.find({longname: f})[0];
|
||||||
|
if (eventDoclet && !description && eventDoclet.description) {
|
||||||
|
description = eventDoclet.description.replace(/<[^>]*>/g, '');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<li><?js var eventDoclet = self.find({longname: f})[0]; ?>
|
<li>
|
||||||
<code><?js= self.linkto(f, parts[1]) ?></code>
|
<code><?js= self.linkto(f, type) ?></code>
|
||||||
<?js if (parts[0]) {
|
<?js if (eventClassName) {
|
||||||
var eventClass = self.find({longname: parts[0]})[0];
|
var eventClass = self.find({longname: eventClassName})[0];
|
||||||
if (eventClass) { ?>
|
if (eventClass) { ?>
|
||||||
(<?js= self.linkto(eventClass.longname) ?>)
|
(<?js= self.linkto(eventClass.longname) ?>)
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
<?js if (eventDoclet && eventDoclet.description) { ?> -
|
<?js if (description) { ?> -
|
||||||
<?js= (eventDoclet ? self.partial('stability.tmpl', eventDoclet) : '') ?>
|
<?js= self.partial('stability.tmpl', eventDoclet || (data.stability ? data : {stability: 'experimental'})) ?>
|
||||||
<?js= eventDoclet.description.replace(/<[^>]*>/g, '') ?>
|
<?js= description ?>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
</li>
|
</li>
|
||||||
<?js }); ?></ul>
|
<?js }); ?></ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user