Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Installation via Bower

$ bower install jquery-stupid-table


Example Usage
-------------

Expand Down Expand Up @@ -52,6 +51,14 @@ Add a `data-sort` attribute of "DATATYPE" to the th elements to make them sortab
by that data type. If you don't want that column to be sortable, just omit the
`data-sort` attribute.

Example Usage with Browserify/Webpack
-------------------------------------

The JS:

require('stupid-table-plugin');

$("table").stupidtable();

Predefined data types
---------------------
Expand Down
11 changes: 9 additions & 2 deletions stupidtable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// Stupid jQuery table plugin.

(function($) {
(function (factory) {
if(typeof module === 'object' && typeof module.exports === 'object') {
factory(require('jquery'), window, document);
} else {
factory(jQuery, window, document);
}
}(function($, window, document, undefined) {

$.fn.stupidtable = function(sortFns) {
return this.each(function() {
var $table = $(this);
Expand Down Expand Up @@ -278,4 +285,4 @@
return th_index;
};

})(jQuery);
}));