Skip to content

Commit

Permalink
fix: resize the panel height error after dragging dvider (fix: #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsik Yoo committed Feb 27, 2018
1 parent b8762ba commit 1f5b3bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/common/vpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ VPanel.prototype.isSplitter = function() {
VPanel.prototype.setHeight = function(container, newHeight, force) {
var maxHeight = this.options.maxHeight;
var minHeight = this.options.minHeight;
var autoHeight = this.options.autoHeight;
container = container || this.container;

// 한번 force 호출이 일어난 이후에는 force 호출만 허용한다
if (!force && this.isHeightForcedSet) {
if (!force && this.isHeightForcedSet && !autoHeight) {
return;
}

Expand Down
9 changes: 9 additions & 0 deletions test/app/common/vpanel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,13 @@ describe('VPanel', function() {

expect(domutil.setData).toHaveBeenCalledWith(container, 'autoHeight', true);
});

it('setHeight() can set specified height after force resizing if options.autoHeight is true', function() {
inst.options.autoHeight = true;
inst.isHeightForcedSet = true;

inst.setHeight(null, 350);

expect(container.style.height).toBe('350px');
});
});

0 comments on commit 1f5b3bc

Please sign in to comment.