Skip to content

Commit fa5d057

Browse files
author
Alain Dumesny
committed
updated float demo as well
1 parent 8bcc658 commit fa5d057

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

demo/float.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<h1>Float grid demo</h1>
2020
<div>
2121
<a class="btn btn-primary" id="add-widget" href="#">Add Widget</a>
22+
<a class="btn btn-primary" id="float" href="#">float: true</a>
2223
</div>
2324
<br><br>
2425
<div class="grid-stack"></div>
@@ -34,19 +35,16 @@ <h1>Float grid demo</h1>
3435

3536
new function () {
3637
this.items = [
37-
{x: 0, y: 0, width: 2, height: 2},
38+
{x: 0, y: 6, width: 2, height: 2},
3839
{x: 3, y: 1, width: 1, height: 2},
39-
{x: 4, y: 1, width: 1, height: 1},
40+
{x: 4, y: 2, width: 1, height: 1},
4041
{x: 2, y: 3, width: 3, height: 1},
41-
// {x: 1, y: 4, width: 1, height: 1},
42-
// {x: 1, y: 3, width: 1, height: 1},
43-
// {x: 2, y: 4, width: 1, height: 1},
4442
{x: 2, y: 5, width: 1, height: 1}
4543
];
4644

4745
this.grid = $('.grid-stack').data('gridstack');
4846

49-
this.addNewWidget = function () {
47+
this.addNewWidget = function() {
5048
var node = this.items.pop() || {
5149
x: 12 * Math.random(),
5250
y: 5 * Math.random(),
@@ -57,7 +55,13 @@ <h1>Float grid demo</h1>
5755
return false;
5856
}.bind(this);
5957

58+
this.toggleFloat = function() {
59+
this.grid.float(! this.grid.float());
60+
$('#float').html('float: ' + this.grid.float());
61+
}.bind(this);;
62+
6063
$('#add-widget').click(this.addNewWidget);
64+
$('#float').click(this.toggleFloat);
6165
};
6266
});
6367
</script>

0 commit comments

Comments
 (0)