Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
New dist files for 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Dec 15, 2014
1 parent 64bf6f1 commit 1b335b0
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dist/bare/tablesaw.bare.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Tablesaw - v1.0.1 - 2014-12-09
/*! Tablesaw - v1.0.1 - 2014-12-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2014 Filament Group; Licensed MIT */

Expand Down
2 changes: 1 addition & 1 deletion dist/stackonly/tablesaw.stackonly.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Tablesaw - v1.0.1 - 2014-12-09
/*! Tablesaw - v1.0.1 - 2014-12-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2014 Filament Group; Licensed MIT */

Expand Down
20 changes: 18 additions & 2 deletions dist/stackonly/tablesaw.stackonly.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Tablesaw - v1.0.1 - 2014-12-09
/*! Tablesaw - v1.0.1 - 2014-12-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2014 Filament Group; Licensed MIT */
;(function( $ ) {
Expand Down Expand Up @@ -27,6 +27,20 @@
}

})( jQuery );
/*
* tablesaw: A set of plugins for responsive tables
* Stack and Column Toggle tables
* Copyright (c) 2013 Filament Group, Inc.
* MIT License
*/

if( typeof Tablesaw === "undefined" ) {
Tablesaw = {};
}
if( !Tablesaw.config ) {
Tablesaw.config = {};
}

;(function( $ ) {
var pluginName = "table",
classes = {
Expand Down Expand Up @@ -230,7 +244,9 @@
Stack.prototype.destroy = function() {
this.$table.removeClass( classes.stackTable );
this.$table.find( '.' + classes.cellLabels ).remove();
this.$table.find( '.' + classes.cellContentLabels ).remove();
this.$table.find( '.' + classes.cellContentLabels ).each(function() {
$( this ).replaceWith( this.childNodes );
});
};

// on tablecreate, init
Expand Down
4 changes: 2 additions & 2 deletions dist/stackonly/tablesaw.stackonly.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! Tablesaw - v1.0.1 - 2014-12-09
/*! Tablesaw - v1.0.1 - 2014-12-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2014 Filament Group; Licensed MIT */
/*! Tablesaw - v1.0.1 - 2014-12-09
/*! Tablesaw - v1.0.1 - 2014-12-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2014 Filament Group; Licensed MIT */

Expand Down
2 changes: 1 addition & 1 deletion dist/tablesaw.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Tablesaw - v1.0.1 - 2014-12-09
/*! Tablesaw - v1.0.1 - 2014-12-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2014 Filament Group; Licensed MIT */

Expand Down
48 changes: 38 additions & 10 deletions dist/tablesaw.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Tablesaw - v1.0.1 - 2014-12-09
/*! Tablesaw - v1.0.1 - 2014-12-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2014 Filament Group; Licensed MIT */
;(function( $ ) {
Expand Down Expand Up @@ -27,6 +27,20 @@
}

})( jQuery );
/*
* tablesaw: A set of plugins for responsive tables
* Stack and Column Toggle tables
* Copyright (c) 2013 Filament Group, Inc.
* MIT License
*/

if( typeof Tablesaw === "undefined" ) {
Tablesaw = {};
}
if( !Tablesaw.config ) {
Tablesaw.config = {};
}

;(function( $ ) {
var pluginName = "table",
classes = {
Expand Down Expand Up @@ -230,7 +244,9 @@
Stack.prototype.destroy = function() {
this.$table.removeClass( classes.stackTable );
this.$table.find( '.' + classes.cellLabels ).remove();
this.$table.find( '.' + classes.cellContentLabels ).remove();
this.$table.find( '.' + classes.cellContentLabels ).each(function() {
$( this ).replaceWith( this.childNodes );
});
};

// on tablecreate, init
Expand Down Expand Up @@ -519,6 +535,14 @@
}( this, jQuery ));
;(function( win, $, undefined ){

$.extend( Tablesaw.config, {
swipe: {
horizontalThreshold: 15,
verticalThreshold: 30
}
});

var config = Tablesaw.config.swipe;

function createSwipeTable( $table ){

Expand Down Expand Up @@ -711,27 +735,31 @@
e.preventDefault();
});

function getCoord( event, key ) {
return ( event.touches || event.originalEvent.touches )[ 0 ][ key ];
}

$table
.bind( "touchstart.swipetoggle", function( e ){
var originX = ( e.touches || e.originalEvent.touches )[ 0 ].pageX,
originY = ( e.touches || e.originalEvent.touches )[ 0 ].pageY,
var originX = getCoord( e, 'pageX' ),
originY = getCoord( e, 'pageY' ),
x,
y;

$( this )
.bind( "touchmove", function( e ){
x = ( e.touches || e.originalEvent.touches )[ 0 ].pageX;
y = ( e.touches || e.originalEvent.touches )[ 0 ].pageY;
x = getCoord( e, 'pageX' );
y = getCoord( e, 'pageY' );

if( Math.abs( x - originX ) > 15 && Math.abs( y - originY ) < 20 ) {
if( Math.abs( x - originX ) > config.horizontalThreshold && Math.abs( y - originY ) < config.verticalThreshold ) {
e.preventDefault();
}
})
.bind( "touchend.swipetoggle", function(){
if( x - originX < 15 ){
if( x - originX < -1 * config.horizontalThreshold ){
advance( true );
}
if( x - originX > -15 ){
if( x - originX > config.horizontalThreshold ){
advance( false );
}

Expand Down Expand Up @@ -957,7 +985,7 @@
},
getSortFxn = function( ascending, forceNumeric ){
var fn,
regex = /[^\d\.]/g;
regex = /[^\-\+\d\.]/g;
if( ascending ){
fn = function( a , b ){
if( forceNumeric || !isNaN( parseFloat( a.cell ) ) ) {
Expand Down

0 comments on commit 1b335b0

Please sign in to comment.