Skip to content

Commit

Permalink
[ui:dialog] fix #1785 trigger resize event with maximize:on in mini…
Browse files Browse the repository at this point in the history
…mize element
  • Loading branch information
nao-pon committed Dec 2, 2016
1 parent fbb814e commit 0ea88ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2725,9 +2725,10 @@ var elFinder = function(node, opts) {
resizeTm,
resize = function(e) {
if (e.target === window && e.data && e.data.elm) {
var elm = e.data.elm;
resizeTm && clearTimeout(resizeTm);
resizeTm = setTimeout(function() {
e.data.elm.trigger('resize', {maximize: 'on'});
elm.trigger('resize', {maximize: 'on'});
}, 100);
}
},
Expand Down
6 changes: 5 additions & 1 deletion js/ui/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,18 @@ $.fn.elfinderdialog = function(opts, fm) {
$this.removeData('style').show();
titlebar.children('.elfinder-titlebar-full').show();
dialog.children('.ui-widget-content').slideDown('fast', function() {
var eData;
if (this === dialog.children('.ui-widget-content:first').get(0)) {
eData = { minimize: 'off' };
if (! dialog.hasClass('elfinder-maximized')) {
try {
dialog.hasClass('ui-draggable') && dialog.draggable('enable');
dialog.hasClass('ui-resizable') && dialog.resizable('enable');
} catch(e) {}
} else {
eData.maximize = 'on';
}
dialog.trigger('resize', { minimize: 'off' });
dialog.trigger('resize', eData);
}
});
} else {
Expand Down

0 comments on commit 0ea88ab

Please sign in to comment.