Skip to content

Commit

Permalink
Update resize.js
Browse files Browse the repository at this point in the history
CS correction and unnecessary code deletion
  • Loading branch information
nao-pon authored Dec 3, 2024
1 parent 0e9fa80 commit f462432
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions js/commands/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +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.find('input'),
width = $(input)
.on('change', function() {
var w = round(parseInt(width.val())),
Expand Down Expand Up @@ -1458,35 +1457,35 @@ 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();
}
})
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

0 comments on commit f462432

Please sign in to comment.