Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3684 #3685

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 31 additions & 30 deletions js/commands/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,35 +207,6 @@ elFinder.prototype.commands.resize = function() {
'<input class="api2" type="radio" name="type" id="'+id+'-crop" value="crop" /><label class="api2" for="'+id+'-crop">'+fm.i18n('crop')+'</label>',
'<input class="api2" type="radio" name="type" id="'+id+'-rotate" value="rotate" /><label class="api2" for="'+id+'-rotate">'+fm.i18n('rotate')+'</label>'),
mode = 'resize',
type = uitype[ctrgrup]()[ctrgrup]('disable').find('input')
.on('change', function() {
mode = $(this).val();

resetView();
resizable(true);
croppable(true);
rotateable(true);

if (mode == 'resize') {
uiresize.show();
uirotate.hide();
uicrop.hide();
resizable();
isJpeg && grid8px.insertAfter(uiresize.find('.elfinder-resize-grid8'));
}
else if (mode == 'crop') {
uirotate.hide();
uiresize.hide();
uicrop.show();
croppable();
isJpeg && grid8px.insertAfter(uicrop.find('.elfinder-resize-grid8'));
} else if (mode == 'rotate') {
uiresize.hide();
uicrop.hide();
uirotate.show();
rotateable();
}
}),
width = $(input)
.on('change', function() {
var w = round(parseInt(width.val())),
Expand Down Expand Up @@ -1484,7 +1455,37 @@ elFinder.prototype.commands.resize = function() {
}
}
}).attr('id', id).closest('.ui-dialog').addClass(clsediting);


// Fix for https://github.com/Studio-42/elFinder/issues/3684
uitype[ctrgrup]()[ctrgrup]('disable').find('input').on('change', function() {
mode = $(this).val();

resetView();
resizable(true);
croppable(true);
rotateable(true);

if (mode == 'resize') {
uiresize.show();
uirotate.hide();
uicrop.hide();
resizable();
isJpeg && grid8px.insertAfter(uiresize.find('.elfinder-resize-grid8'));
}
else if (mode == 'crop') {
uirotate.hide();
uiresize.hide();
uicrop.show();
croppable();
isJpeg && grid8px.insertAfter(uicrop.find('.elfinder-resize-grid8'));
} else if (mode == 'rotate') {
uiresize.hide();
uicrop.hide();
uirotate.show();
rotateable();
}
});

// for IE < 9 dialog mising at open second+ time.
if (fm.UA.ltIE8) {
$('.elfinder-dialog').css('filter', '');
Expand Down
Loading