Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions demo/float.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h1>Float grid demo</h1>
var grid = GridStack.init({float: true});

var items = [
{x: 2, y: 1, width: 1, height: 1},
{x: 2, y: 3, width: 3, height: 1},
{x: 2, y: 1, width: 1, height: 2},
{x: 2, y: 4, width: 3, height: 1},
{x: 4, y: 2, width: 1, height: 1},
{x: 3, y: 1, width: 1, height: 2},
{x: 0, y: 6, width: 2, height: 2}
Expand Down
2 changes: 1 addition & 1 deletion demo/two.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1>Two grids demo</h1>
float: false,
removable: '.trash',
removeTimeout: 100,
acceptWidgets: function(i, el) { return true; } // function example, else can be simple: true | false | '.someClass' value
acceptWidgets: function(el) { return true; } // function example, else can be simple: true | false | '.someClass' value
};
var grids = GridStack.initAll(options);
grids[1].float(true);
Expand Down
12 changes: 6 additions & 6 deletions src/gridstack-dragdrop-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ export class GridStackDragDropPlugin {

static registerPlugin(pluginClass) {
GridStackDragDropPlugin.registeredPlugins.push(pluginClass);
};
}

public constructor(grid: GridStack) {
this.grid = grid;
}

public resizable(el: GridStackElement, opts: DDOpts, key?: DDKey, value?): GridStackDragDropPlugin {
return this;
};
}

public draggable(el: GridStackElement, opts: DDOpts, key?: DDKey, value?): GridStackDragDropPlugin {
return this;
};
}

public droppable(el: GridStackElement, opts: DDOpts, key?: DDKey, value?): GridStackDragDropPlugin {
return this;
};
}

public isDroppable(el: GridStackElement): boolean {
return false;
};
}

public on(el: GridStackElement, eventName: string, callback): GridStackDragDropPlugin {
return this;
};
}
}
8 changes: 4 additions & 4 deletions src/gridstack-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ export class GridStackEngine {
public addNode(node: GridStackNode, triggerAddEvent?: boolean) {
node = this._prepareNode(node);

if (node.maxWidth !== undefined) { node.width = Math.min(node.width, node.maxWidth); }
if (node.maxHeight !== undefined) { node.height = Math.min(node.height, node.maxHeight); }
if (node.minWidth !== undefined) { node.width = Math.max(node.width, node.minWidth); }
if (node.minHeight !== undefined) { node.height = Math.max(node.height, node.minHeight); }
if (node.maxWidth) { node.width = Math.min(node.width, node.maxWidth); }
if (node.maxHeight) { node.height = Math.min(node.height, node.maxHeight); }
if (node.minWidth) { node.width = Math.max(node.width, node.minWidth); }
if (node.minHeight) { node.height = Math.max(node.height, node.minHeight); }

node._id = node._id || GridStackEngine._idSeq++;

Expand Down
Loading