Skip to content

Commit 5326c59

Browse files
committed
【API】 优化枚举类型的api
1 parent 96a3504 commit 5326c59

File tree

19 files changed

+4771
-4169
lines changed

19 files changed

+4771
-4169
lines changed

build/jsdocs/leaflet/categories.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

build/jsdocs/mapboxgl/categories.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

build/jsdocs/openlayers/categories.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

build/jsdocs/template/tmpl/details.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var self = this;
5252

5353
<?js if (data.defaultvalue) {?>
5454
<dt class="tag-default">Default Value:</dt>
55-
<dd class="tag-default"><ul class="dummy"><li><?js= data.defaultvalue ?></li></ul></dd>
55+
<?js= (typeof data.defaultvalue==="string"?self.linkto(data.defaultvalue, self.htmlsafe(data.defaultvalue)):data.defaultvalue) ?></li></ul></dd>
5656
<?js } ?>
5757

5858
<?js if (data.tutorials && tutorials.length) {?>

build/jsdocs/template/tmpl/params.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<?js if (params.hasDefault) {?>
7777
<td class="default">
7878
<?js if (typeof param.defaultvalue !== 'undefined') { ?>
79-
<?js= self.htmlsafe(param.defaultvalue) ?>
79+
<?js= (typeof param.defaultvalue === 'string') ?self.linkto( param.defaultvalue, self.htmlsafe( param.defaultvalue)): self.htmlsafe( param.defaultvalue) ?>
8080
<?js } ?>
8181
</td>
8282
<?js } ?>

build/jsdocs/template/tmpl/properties.tmpl

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
<th>Argument</th>
5252
<?js } ?>
5353

54-
<?js if (props.hasDefault) {?>
55-
<th>Default</th>
56-
<?js } ?>
5754

5855
<th class="last">Description</th>
5956
</tr>
@@ -67,8 +64,21 @@
6764
?>
6865

6966
<tr>
70-
<?js if (props.hasName) {?>
71-
<td class="name"><code><?js= prop.name ?></code></td>
67+
<?js if (props.hasName) {
68+
var idTag="";
69+
if(prop.longname){
70+
var link=self.linkto(prop.longname, self.htmlsafe(prop.longname));
71+
if(link){
72+
var tag=link.match(/.*href=\"[^#]*#(.*)\">/);
73+
if(tag&&tag[1]){
74+
idTag=tag[1];
75+
}
76+
}
77+
}
78+
?>
79+
<td class="name" <?js if(idTag){ ?>
80+
id="<?js=idTag ?>"<?js } ?>
81+
><code><?js= prop.name ?></code></td>
7282
<?js } ?>
7383
7484
<td class="type">
@@ -89,13 +99,6 @@
8999
</td>
90100
<?js } ?>
91101
92-
<?js if (props.hasDefault) {?>
93-
<td class="default">
94-
<?js if (typeof prop.defaultvalue !== 'undefined') { ?>
95-
<?js= self.htmlsafe(prop.defaultvalue) ?>
96-
<?js } ?>
97-
</td>
98-
<?js } ?>
99102
100103
<td class="description last"><?js= prop.description ?><?js if (prop.subprops) { ?>
101104
<h6>Properties</h6><?js= self.partial('properties.tmpl', prop.subprops) ?>

0 commit comments

Comments
 (0)