Authored by liuyue

tab卡保持状态bug

@@ -21,12 +21,11 @@ tab.prototype = { @@ -21,12 +21,11 @@ tab.prototype = {
21 21
22 22
23 var pattern = /tab=.*?(?=&&)/gi, 23 var pattern = /tab=.*?(?=&&)/gi,
24 - tab = null, 24 + tab = pattern.exec(location.hash),
25 index = null; 25 index = null;
26 26
27 -  
28 - if (location.hash != '') {  
29 - tab = pattern.exec(location.hash) ? pattern.exec(location.hash)[0] : ''; 27 + if (tab instanceof Array) {
  28 + tab = tab[0];
30 index = tab.split('=')[1]; 29 index = tab.split('=')[1];
31 } 30 }
32 g.index = index; 31 g.index = index;