diff --git a/safesite/static/safesite/mystatic/js/util.js b/safesite/static/safesite/mystatic/js/util.js index 3fd55fbc..2508d228 100644 --- a/safesite/static/safesite/mystatic/js/util.js +++ b/safesite/static/safesite/mystatic/js/util.js @@ -321,13 +321,28 @@ function isIntNum(val) { // } // } function changehref(o) { - _clickTab = $(o).attr('url');// 找到链接a中的targer的值 + _title = $(o).attr('title'); _value = $(o).attr('value'); $("#main").attr('value', _value); - $("#main").panel({ href: _clickTab, title: $(o).attr('title') }); + + if ($('#tt').tabs('tabs').length > 10) { + alert('标签页过多,请先关闭') + return + } + if ($('#tt').tabs('exists', _title)) { + $('#tt').tabs('select', _title); + //var tab2 = $('#tt').tabs('getSelected'); + //tab2.panel('refresh'); + } else { + $('#tt').tabs('add', { + title: _title, + href: _clickTab, + closable: true, + }); + } // $.ajax({ // type: "get", // url: _clickTab, diff --git a/safesite/templates/index.html b/safesite/templates/index.html index b6ec6c66..1757ff77 100644 --- a/safesite/templates/index.html +++ b/safesite/templates/index.html @@ -114,7 +114,7 @@ headimgurl="{{headimgurl}}" menus="{{menus}}" style="display:none;" /> @@ -178,16 +178,11 @@ -