You need to be logged in to post in the forums. If you do not have an account, please sign up first.
Using variables in the popup-window's dimmensions
Seems like its not working,
I would like to give users options for the dimensions because the size of the content varies, depending on other settings.
Seems I cant do that.
Also not defining the size should be on some automatic mode which would try to avoid using scrollbars at all cost or then whole extension looks terrible.
/Edit
with switch and case I am able to choose from several sizes for the popup window
and with some additional css like max-width and overflow:hidden I am able to control rest of the content it seems.
Using variables will work so long as those variables are defined. You could use something like this to set a default size:
var popupWidth = parseInt(localStorage['popupWidth'] || 100); var popupHeight = parseInt(localStorage['popupHeight'] || 100);
Opera 12.15 - Win 8 Pro x64 All my Opera tools -Tab Vault: Save tabs for later -AutoStack: tabs opened from a stack stay there
Thank you, didn't realize that it was string... and thanks for || 100, would be ugly if I would forgot about clean installation.
True, but if you're just storing numbers, parseInt will do the trick. If you use JSON.parse, make sure you test for the existence of the value first (or use the || trick) as JSON.parse(undefined) gets you an exception instead of a value.
Opera 12.15 - Win 8 Pro x64 All my Opera tools -Tab Vault: Save tabs for later -AutoStack: tabs opened from a stack stay there
Forums » Dev.Opera » Opera Extensions Development Discussions