Skip to content

Commit

Permalink
Merge pull request gridstack#2051 from adumesny/master
Browse files Browse the repository at this point in the history
restored float demo
  • Loading branch information
adumesny committed Sep 24, 2022
2 parents 4e5b095 + c1d7d52 commit 9200ce0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions demo/float.html
Expand Up @@ -23,21 +23,20 @@ <h1>Float grid demo</h1>
<script src="events.js"></script>
<script type="text/javascript">
let grid = GridStack.init({
// float: false,
float: true,
// disableResize: true, // TEST no resizing, but dragging
// resizable: { handles: 'all'} // do all sides for testing
// draggable: { pause: true },
subGrid: { createDynamic: true, column: 'auto' },
resizable: { handles: 'all'} // do all sides for testing
});
addEvents(grid);

let count = 0;
let items = [
{x: 0, y: 0},
{x: 1, y: 0},
{x: 2, y: 0, w: 2},
{x: 1, y: 1}, //, locked:true, content:"locked"},
{x: 2, y: 2, w: 3},
{x: 4, y: 2},
{x: 3, y: 1, h: 2},
{x: 0, y: 6, w: 2, h: 2}
];
items.forEach(e => e.content = String(count++));
let count = 0;

addNewWidget = function() {
let n = items[count] || {
Expand All @@ -46,15 +45,16 @@ <h1>Float grid demo</h1>
w: Math.round(1 + 3 * Math.random()),
h: Math.round(1 + 3 * Math.random())
};
n.content = n.content || String(count++);
n.content = n.content || String(count);
grid.addWidget(n);
count++;
};

toggleFloat = function() {
grid.float(! grid.getFloat());
document.querySelector('#float').innerHTML = 'float: ' + grid.getFloat();
};
grid.load(items);
addNewWidget();
</script>
</body>
</html>

0 comments on commit 9200ce0

Please sign in to comment.