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

Function bindEvents

examples/js/example.js:182–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181//绑定点击事件
182function bindEvents() {
183 var child = $("ul#sidebar-menu>li.treeview>ul>li");
184 var parent = $('ul.sidebar-menu>li').parent("ul");
185 //因为iManager只有1级所以,iManager点击的时候相当于一级菜单,其他的二级都要关闭.
186 if ($('ul.sidebar-menu>li#firstMenuiManager').find('ul').length == 0) {
187 if ($('ul.sidebar-menu>li#firstMenuiManager').click(function () {
188 $('ul#sidebar-menu>li>ul').slideUp(500);
189 }));
190 }
191 //一级菜单跳转
192 child.parent('ul').siblings('a').click(function (evt) {
193 if ($(this).siblings('ul').is(':visible') && $(this).siblings('ul').children('li').hasClass('active')) {
194 evt.stopPropagation(); //阻止点击事件触发折叠的冒泡
195 }
196 window.location = evt.currentTarget.href;
197 });
198
199 //二级菜单跳转,不用 boot自带
200 window.addEventListener("hashchange", function () {
201 scroll();
202 });
203}
204
205var openTimer; // 定义展开的延时
206var animationSpeed = 500;

Callers 1

example.jsFile · 0.70

Calls 4

scrollFunction · 0.85
childrenMethod · 0.80
$Function · 0.50
findMethod · 0.45

Tested by

no test coverage detected