Opened 10 years ago

Last modified 8 years ago

#38 new defect

Calculate size for hidden editors

Reported by: holtwickd Owned by: gogo
Priority: low Milestone:
Component: Xinha Core Version:
Severity: minor Keywords: size
Cc: mokhet@…

Description (last modified by mokhet)

Especially Mozilla isn't very aware of sizes of hidden HTML elements. Therefore it shows some strange behaviours if you show up a hidden editor. My suggestion: Calculate sizes if available, otherwise use fix sizes.

Here's a simple example:

<html>
<head>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Example of Xinha</title>
  <link rel="stylesheet" href="full_example.css" />

  <script type="text/javascript">
    _editor_url = "../";      // This is a path to the base xinha directory.
    _editor_lang = "en";      // And the language we need to use in the editor.
  </script>

  <script type="text/javascript" src="../htmlarea.js"></script>

  <script type="text/javascript">

    var editor;
    xinha_init = function()
    {
        editor = new HTMLArea("myTextArea");
        editor.generate();
    }

    window.onload = xinha_init;
  </script>
</head>

<body onload="xinha_init()">

  <a href="#" onclick="document.getElementById('editors_here').style.display = 'block'; return false">
    Show hidden form ...
  </a>

  <form id="editors_here" style="display:none">
    <p>Editors:</p>
    <textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%">
        Test
    </textarea>
  </form>

</body>
</html>

Change History (2)

comment:1 Changed 10 years ago by mokhet

  • Cc mokhet@… added

i have this issue for a long time in previous version already. Tabs with editors inside. The solution i used was generate the editors only when known events occurs on the tabs (click/cycle through). It works great for me and it's even better cause it lets me load only on demand, but it's not a reliable solution for xinha. Anyone got any information how to naturally fix this problem ?

comment:2 Changed 8 years ago by mokhet

  • Description modified (diff)

related to ticket #367

Note: See TracTickets for help on using tickets.