diff --git a/ajax_stub.js b/ajax_stub.js index f21d8d9966f810704f9b0453a6a0a25ac3353cba..be67a2ac4976f83963f663edadc7e56f89cb2cef 100644 --- a/ajax_stub.js +++ b/ajax_stub.js @@ -37,6 +37,7 @@ voting_system.prototype = { starForm: function() { return this.dispatcher.doCall('starForm',arguments); }, handlePostData: function() { return this.dispatcher.doCall('handlePostData',arguments); }, storeResponse: function() { return this.dispatcher.doCall('storeResponse',arguments); }, - thankyou: function() { return this.dispatcher.doCall('thankyou',arguments); } + thankyou: function() { return this.dispatcher.doCall('thankyou',arguments); }, + saveViewport: function() { return this.dispatcher.doCall('saveViewport',arguments); } } diff --git a/functions.php b/functions.php index 9ad2d3de1f90f9945dcdbcd1f80453ced2f81638..9e5e4635a9d8631914ba33816edc2741f2ed890c 100644 --- a/functions.php +++ b/functions.php @@ -270,7 +270,8 @@ class Voting_System <img src="images/design_survey_12.gif" alt="proceed" /> </a> </p> - </div><!--close introduction-->'; + </div><!--close introduction--> + <script type="text/javascript">setViewPort();</script>'; } function introduction() @@ -770,4 +771,10 @@ class Voting_System </div><!--close introduction-->'; } + + function saveViewport($viewport) + { + $this->voter->viewport = $viewport; + $this->voter->update(); + } } diff --git a/voting_system.js b/voting_system.js index 5a6ae3d2c093912b464f80d4f44fa1c0c6194dd4..d115358d29f3461555763277e753876144e83269 100644 --- a/voting_system.js +++ b/voting_system.js @@ -230,6 +230,6 @@ function setViewPort() viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportheight = document.getElementsByTagName('body')[0].clientHeight } - + voter.saveViewport(viewportwidth+'x'+viewportheight); }