Permalink
Browse files

Merge pull request #107 from mozilla/issue-58-resize-window

Issue 58 resize window
  • Loading branch information...
2 parents 87406dd + 97598ff commit fd35d8f141d6b317090b523c64a65b4632c01b29 @ozten ozten committed Nov 12, 2012
Showing with 15 additions and 2 deletions.
  1. +3 −0 server/views/authentication.ejs
  2. +12 −2 server/views/signin.ejs
@@ -32,6 +32,9 @@
<script type="text/javascript" src="<%= browserid_server %>/authentication_api.js"></script>
<% } %>
<script type="text/javascript">
+localStorage.height = window.outerHeight;
+localStorage.width = window.outerWidth;
+
navigator.id.beginAuthentication(function(email) {
if (email) {
window.location.pathname = '/proxy/' + encodeURIComponent(email);
View
@@ -11,9 +11,19 @@
<script type="text/javascript" src="<%= browserid_server %>/authentication_api.js"></script>
<% } %>
<script>
+if (!! localStorage.width && !! localStorage.height) {
+ var w = parseInt(localStorage.getItem('width'), 10);
+ var h = parseInt(localStorage.getItem('height'), 10);
+ if (! isNaN(w) && w > 100 && ! isNaN(h) && h > 100) {
+ window.resizeTo(w, h);
+ if (localStorage.removeItem) {
+ localStorage.removeItem('width');
+ localStorage.removeItem('height');
+ }
+ }
+}
+
navigator.id.beginAuthentication(function(email) {
- // From mozilla/browserid resources/static/pages/page_helpers.js
- window.resizeTo(700, 375);
if (email === "<%= current_user %>") {
navigator.id.completeAuthentication();
} else {

0 comments on commit fd35d8f

Please sign in to comment.