Features - scroll resize: Add min file and allow to work offline

pull/361/head
Allan Jardine 7 years ago
parent 2ccf40e0db
commit 5ef6098378

@ -0,0 +1,26 @@
/*!
Copyright 2015 SpryMedia Ltd.
License MIT - http://datatables.net/license/mit
This feature plug-in for DataTables will automatically change the DataTables
page length in order to fit inside its container. This can be particularly
useful for control panels and other interfaces which resize dynamically with
the user's browser window instead of scrolling.
Page resizing in DataTables can be enabled by using any one of the following
options:
* Setting the `scrollResize` parameter in the DataTables initialisation to
be true - i.e. `scrollResize: true`
* Setting the `scrollResize` parameter to be true in the DataTables
defaults (thus causing all tables to have this feature) - i.e.
`$.fn.dataTable.defaults.scrollResize = true`.
* Creating a new instance: `new $.fn.dataTable.ScrollResize( table );` where
`table` is a DataTable's API instance.
ScrollResize for DataTables v1.0.0
2015 SpryMedia Ltd - datatables.net/license
*/
(function(a){var e=function(d){var c=this,b=d.table();this.s={dt:d,host:a(b.container()).parent(),header:a(b.header()),footer:a(b.footer()),body:a(b.body()),container:a(b.container()),table:a(b.node())};b=this.s.host;"static"===b.css("position")&&b.css("position","relative");d.on("draw",function(){c._size()});this._attach();this._size()};e.prototype={_size:function(){var d=this.s,c=d.dt,b=c.table(),h=a(d.table).offset().top,g=d.host.height(),f=a("div.dataTables_scrollBody",b.container()),g=g-h-(d.container.height()-
(h+f.height()));a("div.dataTables_scrollBody",b.container()).css({maxHeight:g,height:g});c.fixedColumns&&c.fixedColumns().relayout()},_attach:function(){var d=this,c=a("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");c[0].onload=function(){var b=this.contentDocument.body,a=b.offsetHeight,c=this.contentDocument;(c.defaultView||c.parentWindow).onresize=function(){var f=b.clientHeight||b.offsetHeight,
e=c.documentElement.clientHeight;!f&&e&&(f=e);f!==a&&(a=f,d._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};a.fn.dataTable.ScrollResize=e;a.fn.DataTable.ScrollResize=e;a(document).on("init.dt",function(d,c){"dt"===d.namespace&&(d=new a.fn.dataTable.Api(c),(c.oInit.scrollResize||a.fn.dataTable.defaults.scrollResize)&&new e(d))})})(jQuery);

@ -5,7 +5,7 @@
<title>DataTables page resize example</title> <title>DataTables page resize example</title>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css">
<style type="text/css"> <style type="text/css">
#resize_wrapper { #resize_wrapper {
position: absolute; position: absolute;
@ -16,8 +16,8 @@
} }
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script> <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.scrollResize.js"></script> <script type="text/javascript" language="javascript" src="dataTables.scrollResize.js"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(document).ready( function () { $(document).ready( function () {

@ -5,7 +5,7 @@
<title>DataTables page resize example</title> <title>DataTables page resize example</title>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css">
<style type="text/css"> <style type="text/css">
div.container { div.container {
margin: 0 auto; margin: 0 auto;
@ -28,8 +28,8 @@
} }
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script> <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.scrollResize.js"></script> <script type="text/javascript" language="javascript" src="dataTables.scrollResize.js"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(document).ready( function () { $(document).ready( function () {

@ -5,7 +5,7 @@
<title>DataTables page resize example</title> <title>DataTables page resize example</title>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css">
<style type="text/css"> <style type="text/css">
div.container { div.container {
margin: 0 auto; margin: 0 auto;
@ -47,8 +47,8 @@
} }
</style> </style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script> <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.scrollResize.js"></script> <script type="text/javascript" language="javascript" src="dataTables.scrollResize.js"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(document).ready( function () { $(document).ready( function () {

Loading…
Cancel
Save