(trunk web) use the preference dialog's "compact" mode based on browser window size, rather than whether or not it's an iPhone -- that way it should work for other mobile devices too.

This commit is contained in:
Charles Kerr 2010-08-08 20:58:58 +00:00
parent fa7f51f130
commit ead0ea9800
1 changed files with 26 additions and 26 deletions

View File

@ -892,36 +892,33 @@ Transmission.prototype =
*
*--------------------------------------------*/
showPrefsDialog: function( ) {
showPrefsDialog: function( )
{
var tr = this;
$("#update_blocklist_button").button();
$("#prefs_tabs").tabs();
var args = { };
if( iPhone ) { // tailor the dialog geometry for iPhone
$.extend( args, {
width: 320,
height: 360,
resizable: false,
draggable: false,
position: [ 0, 0 ]
} );
} else {
$.extend( args, {
width: 450,
height: 400
} );
}
$.extend( args, {
var preferredWidth = 450;
var preferredHeight = 400;
var windowWidth = $(window).width();
var windowHeight = $(window).height();
var fullscreen = (windowWidth<=preferredWidth) || (windowHeight<=preferredHeight);
var args = {
close: function(event, ui) { tr.togglePeriodicSessionRefresh( true ); },
width: fullscreen ? windowWidth : preferredWidth,
height: fullscreen ? windowHeight : preferredHeight,
resizable: !fullscreen,
draggable: !fullscreen,
title: 'Preferences',
show: 'blind',
hide: 'blind',
buttons: {
'Close': function() {
$(this).dialog('close');
tr.togglePeriodicSessionRefresh( true );
}
}
} );
buttons: { }
};
if( fullscreen )
args.position = [ 0, 0 ];
else
args.buttons = { 'Close': function() { $(this).dialog('close'); } };
$("#prefs_dialog" ).dialog( args );
tr.togglePeriodicSessionRefresh( false );
},
@ -963,6 +960,9 @@ Transmission.prototype =
{
var tr = this;
$("#update_blocklist_button").button();
$("#prefs_tabs").tabs();
$.each( this.prefsKeys, function( index, key ) {
$(':input#'+key).change( function( e ) {
var control = e.target;