Merge commit '91757911fa3e19bd52e96d4d49d34f8d8dc2bf2e'

This commit is contained in:
Dylan Weiss 2016-02-23 17:50:37 -05:00
commit b41dfe062c
5 changed files with 85 additions and 2 deletions

View file

@ -39,6 +39,7 @@ Join gridstack.js on Slack: https://gridstackjs.troolee.com
- [IE8 support](#ie8-support)
- [Nested grids](#nested-grids)
- [Resizing active grid](#resizing-active-grid)
- [Using AniJS](#using-anijs)
- [The Team](#the-team)
- [Changes](#changes)
- [v0.2.5-dev (Development version)](#v025-dev-development-version)
@ -440,6 +441,10 @@ See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/neste
Resizing on-the-fly is possible, though experimental. This may be used to make gridstack responsive. gridstack will change the total number of columns and will attempt to update the width and x values of each widget to be more logical.
See example: [Responsive grid demo](http://troolee.github.io/gridstack.js/demo/responsive.html)
## Using AniJS
Using AniJS with gridstack is a breeze. In the following example, a listener is added that gets triggered by a widget being added.
See example: [AniJS demo](http://troolee.github.io/gridstack.js/demo/anijs.html)
The Team
========

76
demo/anijs.html Normal file
View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AniJS demo</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<link rel="stylesheet" href="../dist/gridstack.css"/>
<link rel="stylesheet" href="//anijs.github.io/lib/anicollection/anicollection.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script src="../dist/gridstack.js"></script>
<style type="text/css">
.grid-stack {
background: lightgoldenrodyellow;
}
.grid-stack-item-content {
color: #2c3e50;
text-align: center;
background-color: #18bc9c;
}
</style>
</head>
<body>
<div class="container-fluid">
<h1>AniJS demo</h1>
<div>
<a class="btn btn-default" id="add-widget" href="#">Add Widget</a>
</div>
<div>
<h4 data-anijs="if: added, do: swing animated, on: $gridstack">Widget added</h4>
</div>
<br/>
<div class="grid-stack">
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/AniJS/0.9.3/anijs.js"></script>
<script type="text/javascript">
$(function () {
$('.grid-stack').gridstack();
var self = this;
this.grid = $('.grid-stack').data('gridstack');
AniJS.run();
self.gridstackNotifier = AniJS.getNotifier('gridstack');
$('.grid-stack').on('added', function(event, items) {
self.gridstackNotifier.dispatchEvent('added');
});
$('#add-widget').click(function() {
addNewWidget();
});
function addNewWidget() {
var grid = $('.grid-stack').data('gridstack');
grid.addWidget($('<div class="grid-stack-item-content"></div>'), 0, 0, Math.floor(1 + 3 * Math.random()), Math.floor(1 + 3 * Math.random()), true);
}
});
</script>
</body>
</html>

View file

@ -13,6 +13,8 @@
<li><a href="rtl.html">RTL demo</a></li>
<li><a href="serialization.html">Serialization demo</a></li>
<li><a href="two.html">Two grids demo</a></li>
<li><a href="responsive.html">Resize grid (responsive) demo</a></li>
<li><a href="anijs.html">AniJS demo</a></li>
</ul>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long