|
@@ -36,11 +36,16 @@ BaseView.prototype.initI18n.call(window);
|
|
|
},
|
|
},
|
|
|
}).then(function () {
|
|
}).then(function () {
|
|
|
model.set({data: data});
|
|
model.set({data: data});
|
|
|
|
|
+ _.options.get('autoReload') && chrome.tabs.reload(app.currentTab.id);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ function init() {
|
|
|
|
|
+ chrome.tabs.sendMessage(app.currentTab.id, {cmd: 'GetPopup'});
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
var commands = {
|
|
var commands = {
|
|
|
SetPopup: function (data, src, callback) {
|
|
SetPopup: function (data, src, callback) {
|
|
|
|
|
+ if (app.currentTab.id !== src.tab.id) return;
|
|
|
commandsMenu.reset(data.menus.map(function (menu) {
|
|
commandsMenu.reset(data.menus.map(function (menu) {
|
|
|
return new MenuItem({
|
|
return new MenuItem({
|
|
|
name: menu[0],
|
|
name: menu[0],
|
|
@@ -72,6 +77,6 @@ BaseView.prototype.initI18n.call(window);
|
|
|
|
|
|
|
|
chrome.tabs.query({currentWindow: true, active: true}, function (tabs) {
|
|
chrome.tabs.query({currentWindow: true, active: true}, function (tabs) {
|
|
|
app.currentTab = tabs[0];
|
|
app.currentTab = tabs[0];
|
|
|
- chrome.tabs.sendMessage(tabs[0].id, {cmd: 'GetPopup'});
|
|
|
|
|
|
|
+ init();
|
|
|
});
|
|
});
|
|
|
}();
|
|
}();
|