Fix menubar/titlebar-less Standalone window issue in El Capitan

If Standalone is closed in full-screen mode in 10.11, 'sizemode' on the main
window is persisted as 'fullscreen'. On reopen, the window doesn't go into
full-screen mode, but it still lacks menubar or titlebar. This patch forces the
window into 'normal' mode if it was left in 'fullscreen'.

(Firefox appears to ignore 'fullscreen' without actually changing the value,
but I didn't find the code that handles that.)
This commit is contained in:
Dan Stillman 2015-10-02 16:38:33 -04:00
parent a22fe2ecda
commit 488c4eb72b

View file

@ -97,6 +97,13 @@ var ZoteroPane = new function()
* Called when the window containing Zotero pane is open
*/
function init() {
// Fix window without menubar/titlebar when Standalone is closed in full-screen mode
// in OS X 10.11
if (Zotero.isMac && Zotero.isStandalone
&& window.document.documentElement.getAttribute('sizemode') == 'fullscreen') {
window.document.documentElement.setAttribute('sizemode', 'normal');
}
// Set "Report Errors..." label via property rather than DTD entity,
// since we need to reference it in script elsewhere
document.getElementById('zotero-tb-actions-reportErrors').setAttribute('label',