mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(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:
parent
fa7f51f130
commit
ead0ea9800
1 changed files with 26 additions and 26 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue