| Server IP : 66.29.146.62 / Your IP : 216.73.216.152 Web Server : LiteSpeed System : Linux premium231.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 User : dokkdzvi ( 925) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/dokkdzvi/morraa-ksa.store/controlPanel/assets/plugins/tablesaw/src/ |
Upload File : |
/*
* tablesaw: A set of plugins for responsive tables
* minimap: a set of dots to show which columns are currently visible.
* Copyright (c) 2013 Filament Group, Inc.
* MIT License
*/
;(function( win, $, undefined ){
var MM = {
attr: {
init: 'data-tablesaw-minimap'
}
};
function createMiniMap( $table ){
var $btns = $( '<div class="tablesaw-advance minimap">' ),
$dotNav = $( '<ul class="tablesaw-advance-dots">' ).appendTo( $btns ),
hideDot = 'tablesaw-advance-dots-hide',
$headerCells = $table.find( 'thead th' );
// populate dots
$headerCells.each(function(){
$dotNav.append( '<li><i></i></li>' );
});
$btns.appendTo( $table.prev().filter( '.tablesaw-bar' ) );
function showMinimap( $table ) {
var mq = $table.attr( MM.attr.init );
return !mq || win.matchMedia && win.matchMedia( mq ).matches;
}
function showHideNav(){
if( !showMinimap( $table ) ) {
$btns.hide();
return;
}
$btns.show();
// show/hide dots
var dots = $dotNav.find( "li" ).removeClass( hideDot );
$table.find( "thead th" ).each(function(i){
if( $( this ).css( "display" ) === "none" ){
dots.eq( i ).addClass( hideDot );
}
});
}
// run on init and resize
showHideNav();
$( win ).on( "resize", showHideNav );
$table
.bind( "tablesawcolumns.minimap", function(){
showHideNav();
})
.bind( "tablesawdestroy.minimap", function(){
var $t = $( this );
$t.prev().filter( '.tablesaw-bar' ).find( '.tablesaw-advance' ).remove();
$( win ).off( "resize", showHideNav );
$t.unbind( ".minimap" );
});
}
// on tablecreate, init
$( document ).on( "tablesawcreate", function( e, Tablesaw ){
if( ( Tablesaw.mode === 'swipe' || Tablesaw.mode === 'columntoggle' ) && Tablesaw.$table.is( '[ ' + MM.attr.init + ']' ) ){
createMiniMap( Tablesaw.$table );
}
} );
}( this, jQuery ));