mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Popout inbox
Rather than opening the inbox in its own window, let it appear as a browser action popup by default, but allow promotion to its own window if requested.
This commit is contained in:
15
js/index.js
15
js/index.js
@@ -20,10 +20,23 @@
|
||||
|
||||
window.Whisper = window.Whisper || {};
|
||||
if (bg.textsecure.storage.getUnencrypted("number_id") === undefined) {
|
||||
window.location = '/options.html';
|
||||
extension.navigator.tabs.create('/options.html');
|
||||
window.close();
|
||||
} else {
|
||||
new bg.Whisper.InboxView().$el.prependTo(bg.$('body',document));
|
||||
bg.textsecure.storage.putUnencrypted("unreadCount", 0);
|
||||
extension.navigator.setBadgeText("");
|
||||
|
||||
window.addEventListener('beforeunload', function () {
|
||||
chrome.browserAction.setPopup({popup: 'index.html'}); // pop in
|
||||
});
|
||||
|
||||
extension.windows.getCurrent(function (windowInfo) {
|
||||
if (windowInfo.type === 'normal') {
|
||||
bg.$('body', document).addClass('pop-in');
|
||||
} else {
|
||||
bg.$('.popout', document).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user