Skip to content

Commit

Permalink
Merge pull request #83 from ccantill/AIR-4694
Browse files Browse the repository at this point in the history
add minimum column size
  • Loading branch information
ccantill authored Dec 19, 2018
2 parents 0a06caa + 9a07cb0 commit 69f9bca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/extensions/columnsizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(['../override', '../utils', '../jquery'], function(override, utils, $) {
}

$super.init();
var header, key, idx, col, oX, w, offset, resizing=0;
var header, key, idx, col, oX, w, offset, resizing=0, minSize = pluginOptions.minSize || 20;

function startResize(event) {
if($(this).parents('.powergrid')[0] !== grid.container[0]) return;
Expand Down Expand Up @@ -58,9 +58,9 @@ define(['../override', '../utils', '../jquery'], function(override, utils, $) {
function doResize(event) {
var width;
if(resizing == 1) {
width = Math.max(0, event.pageX - oX + w);
width = Math.max(minSize, event.pageX - oX + w);
} else if(resizing == -1) {
width = Math.max(0, oX - event.pageX + w);
width = Math.max(minSize, oX - event.pageX + w);
} else {
return;
}
Expand Down

0 comments on commit 69f9bca

Please sign in to comment.