Search code examples
javascriptwebkitnode-webkitchromium-embedded

node-webkit window width issue


Before minimizing the node-webkit window it looked like this:

Before minimizing

After restoring the node-webkit window it looked like this:

After restoring

package.json

   {
      "name": "Gallay",
      "description": "Simplified Billing",
      "version": "0.1",
      "main": "index.html",
      "window": {
        "icon": "icons/16.png", 
        "show": true,
        "toolbar": false,
        "frame": true,
        "position": "center",
        "width": 507,
        "height": 570,
        "min_width": 507,
        "min_height": 570,
    "max_width": 507,
        "max_height": 570
      }
}

I need fixed width while minimizing and restoring the node-webkit window. How can I solve the above problem?


Solution

  • After including jQuery and the following JavaScript, the problem can be solved.

        $(document).ready(function(){
            $(window).resize(function(){
                window.resizeTo(507,570);
                window.focus();
            });
        });