chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
function FixMenu(menuTable)
|
||||
{
|
||||
if (!menuTable) { return };
|
||||
var tbody = menuTable.getElementsByTagName("TBODY")[0];
|
||||
var tr = tbody.getElementsByTagName("TR")[0];
|
||||
for (var i = 0; i < tr.childNodes.length; i++)
|
||||
{
|
||||
var td = tr.childNodes[i];
|
||||
if (td.tagName && td.tagName.toLowerCase() == 'td')
|
||||
{
|
||||
var anchor = td.getElementsByTagName("A")[0];
|
||||
if (anchor)
|
||||
{
|
||||
var onClick = td.onmouseover;
|
||||
td.onclick = (function (e, method) { return function (evt) { method.call(e); if (window.event) { evt = window.event } evt.cancelBubble = true; RemoveRootHover(e); __disappearAfter = 3000; Menu_Collapse(e) } })(td, onClick);
|
||||
td.onmouseover = (function (e) { return function () { HoverRootMenu(e) } })(td);
|
||||
anchor.style.cursor = "pointer";
|
||||
var submnu = WebForm_GetElementById(td.id + "Items");
|
||||
if (submnu) { anchor.onclick = function () { return false } }
|
||||
td.onmouseout = (function (e) { return function () { RemoveRootHover(e) } })(td);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function HoverRootMenu(item)
|
||||
{
|
||||
var node = (item.tagName.toLowerCase() == "td") ? item : item.cells[0];
|
||||
var data = Menu_GetData(item);
|
||||
if (!data) { return null; }
|
||||
var nodeTable = WebForm_GetElementByTagName(node, "table");
|
||||
if (data.staticHoverClass)
|
||||
{
|
||||
nodeTable.hoverClass = data.staticHoverClass;
|
||||
WebForm_AppendToClassName(nodeTable, data.staticHoverClass);
|
||||
}
|
||||
node = nodeTable.rows[0].cells[0].childNodes[0];
|
||||
if (data.staticHoverHyperLinkClass) { node.hoverHyperLinkClass = data.staticHoverHyperLinkClass; WebForm_AppendToClassName(node, data.staticHoverHyperLinkClass) }
|
||||
return node;
|
||||
}
|
||||
|
||||
function RemoveRootHover(item)
|
||||
{
|
||||
var node = (item.tagName.toLowerCase() == "td") ? item : item.cells[0];
|
||||
var data = Menu_GetData(item);
|
||||
if (!data) { return null; }
|
||||
var nodeTable = WebForm_GetElementByTagName(node, "table");
|
||||
if (nodeTable.hoverClass) { WebForm_RemoveClassName(nodeTable, nodeTable.hoverClass) }
|
||||
node = nodeTable.rows[0].cells[0].childNodes[0];
|
||||
if (node.hoverHyperLinkClass) { WebForm_RemoveClassName(node, node.hoverHyperLinkClass) }
|
||||
}
|
||||
Reference in New Issue
Block a user