The bookmarklet popup window in Movable Type has been annoying on my system, because it pops up too tall to fit on my screen. I run at 1024 × 768 resolution, and with all the features turned on for a bookmarklet (TrackBack items, Category, Allow Comments, the works), the height of the window comes out to 880, considerably taller than my screen.
The problem with having a window this tall is that it makes it hard to get to the Post and Cancel buttons at the bottom of the window. All of the text fits within the window, so there is no scroll bar supplied by the browser (I’m using IE, but I suspect this happens in other browsers, too). However, not all of the window fits on my screen, so the bottom part of the form is hidden from view. I have to resize or maximize the window before I get a scroll bar, and only then can I get to the buttons at the bottom of the form.
Fortunately, it’s a fairly easy fix. I modified the _bm_js function in lib/MT/App/CMS.pm to generate better JavaScript that takes the actual height of the display into account when setting the window’s height. Here is the altered function:
The only change here is in the height= part of the JavaScript line. Instead of the original
height=
I’ve used the following conditional statement
height==(($height > screen.height) ? screen.height : $height)
In English, if the height of the window, as calculated by the make_bm_link function in CMS.pm, is greater than the actual height of the screen, set the window to the screen height. Otherwise, use the calculated height.
This fix makes the popup window work better for people who use lower screen resolutions. More importantly, it doesn’t annoy the crap out of me any more.
2 Comments
ok dokie
cool