MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / createSideBarMenuItem

Function createSideBarMenuItem

examples/js/sidebar.js:94–133  ·  view source on GitHub ↗
(id, config, containAll)

Source from the content-addressed store, hash-verified

92
93//创建菜单项
94function createSideBarMenuItem(id, config, containAll) {
95 containExample = containAll;
96
97 if (!config) {
98 return;
99 }
100 if (window.isLocal && config.localIgnore) {
101 return;
102 }
103 if (config.content) {
104 var hasNewExamples = false;
105 a: for (var key in config.content) {
106 var examples = config.content[key].content;
107 if (examples) {
108 for (var index = 0; index < examples.length; index++) {
109 var element = examples[index];
110 if (element.version === window.version) {
111 config.content[key].hasNewExamples = true;
112 hasNewExamples = true;
113 continue a;
114 }
115 }
116 }
117 }
118 config.hasNewExamples = hasNewExamples;
119 }
120
121
122
123
124 var title = utils.getLocalPairs(config, "name");
125 var li = $("<li id='iclient_" + id + "' class='treeview ' title='" + title + "'></li>");
126 if (config.content) {
127 createSideBarMenuTitle(id, title, true, config.hasNewExamples).appendTo(li);
128 createSideBarSecondMenu(config.content, id).appendTo(li);
129 } else {
130 createSideBarMenuTitle(id, title, false, config.hasNewExamples).appendTo(li);
131 }
132 return li;
133}
134
135//创建二级菜单
136function createSideBarSecondMenu(config, name) {

Callers 3

initSideBarFunction · 0.85
initSideBarFunction · 0.85
initPageFunction · 0.85

Calls 4

createSideBarMenuTitleFunction · 0.85
createSideBarSecondMenuFunction · 0.85
appendToMethod · 0.80
$Function · 0.50

Tested by

no test coverage detected