forked from gridstack/gridstack.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gridstack#2548 from adumesny/gh-pages
web v10.0.0
- Loading branch information
Showing
25 changed files
with
135 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Responsive breakpoint</title> | ||
|
||
<link rel="stylesheet" href="demo.css"/> | ||
<link rel="stylesheet" href="../node_modules/gridstack/dist/gridstack-extra.min.css"/> | ||
<script src="../node_modules/gridstack/dist/gridstack-all.js"></script> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>Responsive: using breakpoint</h1> | ||
<p>Using new v10 <code>GridStackOptions.columnOpts: { breakpoints: [] }</code></p> | ||
<div> | ||
<span>Number of Columns:</span> <span id="column-text"></span> | ||
</div> | ||
<div> | ||
<label>Choose re-layout:</label> | ||
<select onchange="grid.opts.columnOpts.layout = this.value"> | ||
<option value="moveScale">move + scale</option> | ||
<option value="move">move</option> | ||
<option value="scale">scale</option> | ||
<option value="list">list</option> | ||
<option value="compact">compact</option> | ||
<option value="none">none</option> | ||
</select> | ||
<a onClick="grid.removeAll()" class="btn btn-primary" href="#">Clear</a> | ||
<a onClick="addWidget()" class="btn btn-primary" href="#">Add Widget</a> | ||
</div> | ||
<br/> | ||
<div class="grid-stack"> | ||
</div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
let text = document.querySelector('#column-text'); | ||
|
||
function addWidget() { | ||
grid.addWidget({x:0, y:0, w:4, id:count++, content: '4x1'}); | ||
}; | ||
|
||
let count = 0; | ||
let items = [ // our initial 12 column layout loaded first so we can compare | ||
{x: 0, y: 0}, | ||
{x: 1, y: 0, w: 2, h: 2}, | ||
{x: 4, y: 0, w: 2}, | ||
{x: 1, y: 3, w: 4}, | ||
{x: 5, y: 3, w: 2}, | ||
{x: 0, y: 4, w: 12} | ||
]; | ||
items.forEach(n => {n.id = count; n.content = String(count++)}); | ||
|
||
let grid = GridStack.init({ | ||
cellHeight: 80, | ||
animate: false, // show immediate (animate: true is nice for user dragging though) | ||
columnOpts: { | ||
breakpointForWindow: true, // test window vs grid size | ||
breakpoints: [{w:700, c:1},{w:850, c:3},{w:950, c:6},{w:1100, c:8}] | ||
}, | ||
children: items, | ||
float: true }) | ||
.on('change', (ev, gsItems) => text.innerHTML = grid.getColumn()); | ||
text.innerHTML = grid.getColumn(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.