|
87 | 87 | } |
88 | 88 |
|
89 | 89 | var curVersion = localStorage.getItem('version') || '', |
90 | | - isOldVersion = (curVersion === '2.0'); |
| 90 | + isOldVersion = (curVersion < '2.1.1' && curVersion !== ''); |
| 91 | + |
| 92 | + var $body = $('body'); |
| 93 | + |
91 | 94 | //user has never seen update |
92 | 95 | if(!localStorage.getItem('update-seen') || isOldVersion){ |
93 | | - var $body = $('body'); |
94 | 96 | $body.addClass('update'); |
95 | 97 | if(isOldVersion){ |
96 | 98 | localStorage.removeItem('update-seen'); |
|
102 | 104 | } |
103 | 105 |
|
104 | 106 | if(localStorage.getItem('update-seen') && updateCount === resize.badgeLimit && !localStorage.getItem('promo-seen')){ |
105 | | - var $body = $('body'); |
106 | 107 | $body.addClass('promo'); |
107 | 108 | resize.options.showPromoModal(); |
108 | 109 | } |
|
183 | 184 | window.chrome.tabs.query({currentWindow: true}, |
184 | 185 | function (tabs) { |
185 | 186 | resize.tabsArray = tabs; |
186 | | - window.chrome.tabs.query({currentWindow: true, active: true}, |
187 | | - function (tab) { |
188 | | - resize.currentTab = tab[0]; |
189 | | - var cb = function(){ |
190 | | - return backJs.util.processTabs(resize, resize.tabsArray, resize.currentTab.index, resize.currentTab.windowId, resize.singleTab, resize.currentTab.incognito); |
191 | | - }; |
192 | | - if(resize.singleTab){ |
193 | | - backJs.util.setUndoStorage(resize,resize.currentTab.index,resize.currentTab.windowId, resize.tabsArray.slice(resize.currentTab.index,resize.currentTab.index + 1), cb); |
194 | | - } else { |
195 | | - backJs.util.setUndoStorage(resize, resize.currentTab.index,resize.currentTab.windowId, resize.tabsArray.slice(resize.currentTab.index), cb); |
196 | | - } |
| 187 | + window.chrome.tabs.query({currentWindow: true, highlighted: true}, |
| 188 | + function (tab) { |
| 189 | + resize.currentTab = tab[0]; |
| 190 | + var index = resize.currentTab.index; |
| 191 | + if(tab.length > 1){ |
| 192 | + resize.tabsArray = tab; |
| 193 | + index = 0; |
| 194 | + } |
197 | 195 |
|
| 196 | + var cb = function(){ |
| 197 | + return backJs.util.processTabs(resize, resize.tabsArray, index, resize.currentTab.windowId, resize.singleTab, resize.currentTab.incognito); |
| 198 | + }; |
| 199 | + if(resize.singleTab){ |
| 200 | + backJs.util.setUndoStorage(resize,resize.currentTab.index,resize.currentTab.windowId, resize.tabsArray.slice(index,index + 1), cb); |
| 201 | + } else { |
| 202 | + backJs.util.setUndoStorage(resize,resize.currentTab.index,resize.currentTab.windowId, resize.tabsArray.slice(index), cb); |
198 | 203 | } |
199 | | - ); |
| 204 | + |
| 205 | + } |
| 206 | + ); |
200 | 207 | } |
201 | 208 | ); |
202 | 209 | } |
|
0 commit comments