Fixed resizing of widgets

Change-Id: I566a28acbaa01cbcbf3a0adc55c3de879e2e8434
diff --git a/dev/js/src/plugin/client.js b/dev/js/src/plugin/client.js
index 1c2af18..64f0bc4 100644
--- a/dev/js/src/plugin/client.js
+++ b/dev/js/src/plugin/client.js
@@ -44,7 +44,6 @@
     _init : function () {
       this.widgetID = window.name;
       this.server = cs.getAttribute('data-server') || '*';
-      this.resize();
       return this;
     },
 
@@ -72,19 +71,9 @@
      * embedding KorAP
      */
     resize : function () {
-      var body = document.body;
-
-      // recognize margin of first element
-      // (don't know why in FF)
-      var cs = getComputedStyle(body.children[0]);
-
-      var offsetHeight = parseInt(body.offsetHeight) +
-          parseInt(cs.getPropertyValue("margin-top")) +
-          parseInt(cs.getPropertyValue("margin-bottom"));
-
       this._sendMsg({
         'action' : 'resize',
-        'height' : offsetHeight
+        'height' : document.documentElement.scrollHeight
       });
     }
   };
@@ -92,7 +81,7 @@
   // Create plugin on windows load
   window.onload = function () {
     window.KorAPlugin = window.KorAPlugin || obj.create();
+    window.KorAPlugin.resize();
   };
 })();
 
-