[mythtv] javascript debugging question...

Robert Kulagowski rkulagow at gmail.com
Wed Apr 13 17:53:51 UTC 2011


in html/setup/js/setup.js there's this routine, which I'm modifying to
take into effect auto-height, so that longer help text results in a
larger window:

function showHelp(title, content) {
    $("#helpWindow").dialog({
      'title': title,
      'width': 300,
/* No magic values; 32px for the titlebar, then calculate how many lines of
   text based on 30 characters/line, then that times 17px.
*/
      'height': 32 + ((content.length % 30)*17),
      'position': [(window.innerWidth - 330), (window.innerHeight - 180)]
    });
    $("#helpWindow").html(content);
    showHelpWindow();
}


I'm trying to work out what's going wrong with the "height"; my logic
is that the default width allows 30 characters per line, so we want to
determine how many lines are required for the content being passed to
the function.  However, things aren't working out.  I've tried both
Chrome and Firebug so that I can dig down and see what's happening to
the function, but can't seem to get either to breakpoint within the
routine so that I can examine content.length.

Any clues?


More information about the mythtv-dev mailing list