diff --git a/lib/hashauth.js b/lib/hashauth.js index 1421c076535..8848ca08ef0 100644 --- a/lib/hashauth.js +++ b/lib/hashauth.js @@ -91,7 +91,12 @@ hashauth.init = function init(client, $) { hashauth.requestAuthentication = function requestAuthentication (eventOrNext) { var translate = client.translate; hashauth.injectHtml(); - var clientWidth = Math.min(400, $( '#container')[0].clientWidth); + + var clientWidth = window.innerWidth + || document.documentElement.clientWidth + || document.body.clientWidth; + + clientWidth = Math.min(400, clientWidth); $( '#requestauthenticationdialog' ).dialog({ width: clientWidth