kopia lustrzana https://github.com/hholzgra/maposmatic/
set orientation choice to new preferred orientation parameter
rodzic
9901bc2a53
commit
7ad62a23b4
|
@ -148,14 +148,14 @@ $('#wizard-step-paper-size').bind('prepare', function(e) {
|
|||
return null;
|
||||
}
|
||||
|
||||
function handle_paper_size_click(w, h, p_ok, l_ok) {
|
||||
function handle_paper_size_click(w, h, p_ok, l_ok, l_preferred) {
|
||||
var l = $('#paper-selection input[value=landscape]');
|
||||
var p = $('#paper-selection input[value=portrait]');
|
||||
|
||||
if (l_ok) {
|
||||
l.removeAttr('disabled');
|
||||
if (!p_ok) { l.attr('checked', 'checked'); }
|
||||
} else {
|
||||
} else
|
||||
l.attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
|
@ -166,6 +166,14 @@ $('#wizard-step-paper-size').bind('prepare', function(e) {
|
|||
p.attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
if (l_ok && p_ok) {
|
||||
if (l_preferred) {
|
||||
l.attr('checked', 'checked');
|
||||
} else {
|
||||
p.attr('checked', 'checked');
|
||||
}
|
||||
}
|
||||
|
||||
$('#id_paper_width_mm').val(w);
|
||||
$('#id_paper_height_mm').val(h);
|
||||
}
|
||||
|
@ -179,7 +187,7 @@ $('#wizard-step-paper-size').bind('prepare', function(e) {
|
|||
var def = get_paper_def(paper);
|
||||
if (def) {
|
||||
$('label', item).bind('click', function() {
|
||||
handle_paper_size_click(def[1], def[2], def[3], def[4]);
|
||||
handle_paper_size_click(def[1], def[2], def[3], def[4], def[6]);
|
||||
});
|
||||
|
||||
if (def[5]) {
|
||||
|
|
Ładowanie…
Reference in New Issue