diff --git a/dist/stackonly/tablesaw.stackonly.css b/dist/stackonly/tablesaw.stackonly.css index 19e55dc..604ecfc 100644 --- a/dist/stackonly/tablesaw.stackonly.css +++ b/dist/stackonly/tablesaw.stackonly.css @@ -1,6 +1,6 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ .tablesaw { width: 100%; diff --git a/dist/stackonly/tablesaw.stackonly.jquery.js b/dist/stackonly/tablesaw.stackonly.jquery.js index 512636c..3fc8a2f 100644 --- a/dist/stackonly/tablesaw.stackonly.jquery.js +++ b/dist/stackonly/tablesaw.stackonly.jquery.js @@ -1,19 +1,26 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ (function (root, factory) { if (typeof define === 'function' && define.amd) { define(["jquery"], function (jQuery) { return (root.Tablesaw = factory(jQuery, root)); }); } else if (typeof exports === 'object') { - module.exports = factory(require('jquery')(root), root); + if( "document" in root ) { + module.exports = factory(require('jquery'), root); + } else { + // special jQuery case for CommonJS (pass in a window) + module.exports = factory(require('jquery')(root), root); + } } else { root.Tablesaw = factory(jQuery, root); } -}(typeof window !== "undefined" ? window : this, function ($, win) { +}(typeof window !== "undefined" ? window : this, function ($, window) { "use strict"; + var document = window.document; + var domContentLoadedTriggered = false; document.addEventListener("DOMContentLoaded", function() { domContentLoadedTriggered = true; @@ -55,7 +62,7 @@ var Tablesaw = { } }; -$(win.document).on("enhance.tablesaw", function() { +$(document).on("enhance.tablesaw", function() { // Extend i18n config, if one exists. if (typeof TablesawConfig !== "undefined" && TablesawConfig.i18n) { Tablesaw.i18n = $.extend(Tablesaw.i18n, TablesawConfig.i18n || {}); @@ -480,7 +487,7 @@ if (Tablesaw.mustard) { }); }; - var $doc = $(win.document); + var $doc = $(document); $doc.on("enhance.tablesaw", function(e) { // Cut the mustard if (Tablesaw.mustard) { @@ -500,17 +507,17 @@ if (Tablesaw.mustard) { $doc.on("scroll.tablesaw", function() { isScrolling = true; - win.clearTimeout(scrollTimeout); - scrollTimeout = win.setTimeout(function() { + window.clearTimeout(scrollTimeout); + scrollTimeout = window.setTimeout(function() { isScrolling = false; }, 300); // must be greater than the resize timeout below }); var resizeTimeout; - $(win).on("resize", function() { + $(window).on("resize", function() { if (!isScrolling) { - win.clearTimeout(resizeTimeout); - resizeTimeout = win.setTimeout(function() { + window.clearTimeout(resizeTimeout); + resizeTimeout = window.setTimeout(function() { $doc.trigger(events.resize); }, 150); // must be less than the scrolling timeout above. } diff --git a/dist/stackonly/tablesaw.stackonly.js b/dist/stackonly/tablesaw.stackonly.js index bd162de..cc824b9 100644 --- a/dist/stackonly/tablesaw.stackonly.js +++ b/dist/stackonly/tablesaw.stackonly.js @@ -1,6 +1,6 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ /*! Shoestring - v2.0.0 - 2017-02-14 * http://github.com/filamentgroup/shoestring/ * Copyright (c) 2017 Scott Jehl, Filament Group, Inc; Licensed MIT & GPLv2 */ @@ -1718,9 +1718,10 @@ } else { root.Tablesaw = factory(shoestring, root); } -}(typeof window !== "undefined" ? window : this, function ($, win) { +}(typeof window !== "undefined" ? window : this, function ($, window) { "use strict"; + var document = window.document; var domContentLoadedTriggered = false; document.addEventListener("DOMContentLoaded", function() { domContentLoadedTriggered = true; @@ -1762,7 +1763,7 @@ var Tablesaw = { } }; -$(win.document).on("enhance.tablesaw", function() { +$(document).on("enhance.tablesaw", function() { // Extend i18n config, if one exists. if (typeof TablesawConfig !== "undefined" && TablesawConfig.i18n) { Tablesaw.i18n = $.extend(Tablesaw.i18n, TablesawConfig.i18n || {}); @@ -2187,7 +2188,7 @@ if (Tablesaw.mustard) { }); }; - var $doc = $(win.document); + var $doc = $(document); $doc.on("enhance.tablesaw", function(e) { // Cut the mustard if (Tablesaw.mustard) { @@ -2207,17 +2208,17 @@ if (Tablesaw.mustard) { $doc.on("scroll.tablesaw", function() { isScrolling = true; - win.clearTimeout(scrollTimeout); - scrollTimeout = win.setTimeout(function() { + window.clearTimeout(scrollTimeout); + scrollTimeout = window.setTimeout(function() { isScrolling = false; }, 300); // must be greater than the resize timeout below }); var resizeTimeout; - $(win).on("resize", function() { + $(window).on("resize", function() { if (!isScrolling) { - win.clearTimeout(resizeTimeout); - resizeTimeout = win.setTimeout(function() { + window.clearTimeout(resizeTimeout); + resizeTimeout = window.setTimeout(function() { $doc.trigger(events.resize); }, 150); // must be less than the scrolling timeout above. } diff --git a/dist/stackonly/tablesaw.stackonly.scss b/dist/stackonly/tablesaw.stackonly.scss index 89cacb6..70b3932 100644 --- a/dist/stackonly/tablesaw.stackonly.scss +++ b/dist/stackonly/tablesaw.stackonly.scss @@ -1,9 +1,9 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ -/*! Tablesaw - v3.0.6 - 2017-11-20 +* Copyright (c) 2018 Filament Group; Licensed MIT */ +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ .tablesaw { width: 100%; diff --git a/dist/tablesaw-init.js b/dist/tablesaw-init.js index 2644dd3..68cb166 100644 --- a/dist/tablesaw-init.js +++ b/dist/tablesaw-init.js @@ -1,6 +1,6 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ (function(win) { "use strict"; diff --git a/dist/tablesaw.css b/dist/tablesaw.css index 6c8d277..a3b3460 100644 --- a/dist/tablesaw.css +++ b/dist/tablesaw.css @@ -1,6 +1,6 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ .tablesaw { width: 100%; diff --git a/dist/tablesaw.jquery.js b/dist/tablesaw.jquery.js index a64f825..957ba73 100644 --- a/dist/tablesaw.jquery.js +++ b/dist/tablesaw.jquery.js @@ -1,19 +1,26 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ (function (root, factory) { if (typeof define === 'function' && define.amd) { define(["jquery"], function (jQuery) { return (root.Tablesaw = factory(jQuery, root)); }); } else if (typeof exports === 'object') { - module.exports = factory(require('jquery')(root), root); + if( "document" in root ) { + module.exports = factory(require('jquery'), root); + } else { + // special jQuery case for CommonJS (pass in a window) + module.exports = factory(require('jquery')(root), root); + } } else { root.Tablesaw = factory(jQuery, root); } -}(typeof window !== "undefined" ? window : this, function ($, win) { +}(typeof window !== "undefined" ? window : this, function ($, window) { "use strict"; + var document = window.document; + var domContentLoadedTriggered = false; document.addEventListener("DOMContentLoaded", function() { domContentLoadedTriggered = true; @@ -55,7 +62,7 @@ var Tablesaw = { } }; -$(win.document).on("enhance.tablesaw", function() { +$(document).on("enhance.tablesaw", function() { // Extend i18n config, if one exists. if (typeof TablesawConfig !== "undefined" && TablesawConfig.i18n) { Tablesaw.i18n = $.extend(Tablesaw.i18n, TablesawConfig.i18n || {}); @@ -480,7 +487,7 @@ if (Tablesaw.mustard) { }); }; - var $doc = $(win.document); + var $doc = $(document); $doc.on("enhance.tablesaw", function(e) { // Cut the mustard if (Tablesaw.mustard) { @@ -500,17 +507,17 @@ if (Tablesaw.mustard) { $doc.on("scroll.tablesaw", function() { isScrolling = true; - win.clearTimeout(scrollTimeout); - scrollTimeout = win.setTimeout(function() { + window.clearTimeout(scrollTimeout); + scrollTimeout = window.setTimeout(function() { isScrolling = false; }, 300); // must be greater than the resize timeout below }); var resizeTimeout; - $(win).on("resize", function() { + $(window).on("resize", function() { if (!isScrolling) { - win.clearTimeout(resizeTimeout); - resizeTimeout = win.setTimeout(function() { + window.clearTimeout(resizeTimeout); + resizeTimeout = window.setTimeout(function() { $doc.trigger(events.resize); }, 150); // must be less than the scrolling timeout above. } @@ -1577,7 +1584,7 @@ if (Tablesaw.mustard) { function matchesMedia() { var matchMedia = $table.attr("data-tablesaw-swipe-media"); - return !matchMedia || ("matchMedia" in win && win.matchMedia(matchMedia).matches); + return !matchMedia || ("matchMedia" in window && window.matchMedia(matchMedia).matches); } function fakeBreakpoints() { @@ -1674,7 +1681,7 @@ if (Tablesaw.mustard) { var y; var scrollTop = window.pageYOffset; - $(win).off(Tablesaw.events.resize, fakeBreakpoints); + $(window).off(Tablesaw.events.resize, fakeBreakpoints); $(this) .on("touchmove.swipetoggle", function(e) { @@ -1711,7 +1718,7 @@ if (Tablesaw.mustard) { } window.setTimeout(function() { - $(win).on(Tablesaw.events.resize, fakeBreakpoints); + $(window).on(Tablesaw.events.resize, fakeBreakpoints); }, 300); $(this).off("touchmove.swipetoggle touchend.swipetoggle"); @@ -1741,7 +1748,7 @@ if (Tablesaw.mustard) { $t.removeClass("tablesaw-swipe"); tblsaw.$toolbar.find(".tablesaw-advance").remove(); - $(win).off(Tablesaw.events.resize, fakeBreakpoints); + $(window).off(Tablesaw.events.resize, fakeBreakpoints); $t.off(".swipetoggle"); }) @@ -1752,7 +1759,7 @@ if (Tablesaw.mustard) { }); fakeBreakpoints(); - $(win).on(Tablesaw.events.resize, fakeBreakpoints); + $(window).on(Tablesaw.events.resize, fakeBreakpoints); } // on tablecreate, init @@ -1776,9 +1783,9 @@ if (Tablesaw.mustard) { if (mq === "") { // value-less but exists return true; - } else if (mq && "matchMedia" in win) { + } else if (mq && "matchMedia" in window) { // has a mq value - return win.matchMedia(mq).matches; + return window.matchMedia(mq).matches; } return false; @@ -1817,7 +1824,7 @@ if (Tablesaw.mustard) { // run on init and resize showHideNav(); - $(win).on(Tablesaw.events.resize, showHideNav); + $(window).on(Tablesaw.events.resize, showHideNav); $table .on("tablesawcolumns.minimap", function() { @@ -1827,7 +1834,7 @@ if (Tablesaw.mustard) { var $t = $(this); tblsaw.$toolbar.find(".tablesaw-advance").remove(); - $(win).off(Tablesaw.events.resize, showHideNav); + $(window).off(Tablesaw.events.resize, showHideNav); $t.off(".minimap"); }); @@ -1925,7 +1932,7 @@ if (Tablesaw.mustard) { } }; - $(win.document).on(Tablesaw.events.create, function(e, Tablesaw) { + $(document).on(Tablesaw.events.create, function(e, Tablesaw) { if (Tablesaw.$table.is(S.selectors.init)) { S.init(Tablesaw.table); } diff --git a/dist/tablesaw.js b/dist/tablesaw.js index ef78908..a49176a 100644 --- a/dist/tablesaw.js +++ b/dist/tablesaw.js @@ -1,6 +1,6 @@ -/*! Tablesaw - v3.0.6 - 2017-11-20 +/*! Tablesaw - v3.0.7 - 2018-01-24 * https://github.com/filamentgroup/tablesaw -* Copyright (c) 2017 Filament Group; Licensed MIT */ +* Copyright (c) 2018 Filament Group; Licensed MIT */ /*! Shoestring - v2.0.0 - 2017-02-14 * http://github.com/filamentgroup/shoestring/ * Copyright (c) 2017 Scott Jehl, Filament Group, Inc; Licensed MIT & GPLv2 */ @@ -1718,9 +1718,10 @@ } else { root.Tablesaw = factory(shoestring, root); } -}(typeof window !== "undefined" ? window : this, function ($, win) { +}(typeof window !== "undefined" ? window : this, function ($, window) { "use strict"; + var document = window.document; var domContentLoadedTriggered = false; document.addEventListener("DOMContentLoaded", function() { domContentLoadedTriggered = true; @@ -1762,7 +1763,7 @@ var Tablesaw = { } }; -$(win.document).on("enhance.tablesaw", function() { +$(document).on("enhance.tablesaw", function() { // Extend i18n config, if one exists. if (typeof TablesawConfig !== "undefined" && TablesawConfig.i18n) { Tablesaw.i18n = $.extend(Tablesaw.i18n, TablesawConfig.i18n || {}); @@ -2187,7 +2188,7 @@ if (Tablesaw.mustard) { }); }; - var $doc = $(win.document); + var $doc = $(document); $doc.on("enhance.tablesaw", function(e) { // Cut the mustard if (Tablesaw.mustard) { @@ -2207,17 +2208,17 @@ if (Tablesaw.mustard) { $doc.on("scroll.tablesaw", function() { isScrolling = true; - win.clearTimeout(scrollTimeout); - scrollTimeout = win.setTimeout(function() { + window.clearTimeout(scrollTimeout); + scrollTimeout = window.setTimeout(function() { isScrolling = false; }, 300); // must be greater than the resize timeout below }); var resizeTimeout; - $(win).on("resize", function() { + $(window).on("resize", function() { if (!isScrolling) { - win.clearTimeout(resizeTimeout); - resizeTimeout = win.setTimeout(function() { + window.clearTimeout(resizeTimeout); + resizeTimeout = window.setTimeout(function() { $doc.trigger(events.resize); }, 150); // must be less than the scrolling timeout above. } @@ -3284,7 +3285,7 @@ if (Tablesaw.mustard) { function matchesMedia() { var matchMedia = $table.attr("data-tablesaw-swipe-media"); - return !matchMedia || ("matchMedia" in win && win.matchMedia(matchMedia).matches); + return !matchMedia || ("matchMedia" in window && window.matchMedia(matchMedia).matches); } function fakeBreakpoints() { @@ -3381,7 +3382,7 @@ if (Tablesaw.mustard) { var y; var scrollTop = window.pageYOffset; - $(win).off(Tablesaw.events.resize, fakeBreakpoints); + $(window).off(Tablesaw.events.resize, fakeBreakpoints); $(this) .on("touchmove.swipetoggle", function(e) { @@ -3418,7 +3419,7 @@ if (Tablesaw.mustard) { } window.setTimeout(function() { - $(win).on(Tablesaw.events.resize, fakeBreakpoints); + $(window).on(Tablesaw.events.resize, fakeBreakpoints); }, 300); $(this).off("touchmove.swipetoggle touchend.swipetoggle"); @@ -3448,7 +3449,7 @@ if (Tablesaw.mustard) { $t.removeClass("tablesaw-swipe"); tblsaw.$toolbar.find(".tablesaw-advance").remove(); - $(win).off(Tablesaw.events.resize, fakeBreakpoints); + $(window).off(Tablesaw.events.resize, fakeBreakpoints); $t.off(".swipetoggle"); }) @@ -3459,7 +3460,7 @@ if (Tablesaw.mustard) { }); fakeBreakpoints(); - $(win).on(Tablesaw.events.resize, fakeBreakpoints); + $(window).on(Tablesaw.events.resize, fakeBreakpoints); } // on tablecreate, init @@ -3483,9 +3484,9 @@ if (Tablesaw.mustard) { if (mq === "") { // value-less but exists return true; - } else if (mq && "matchMedia" in win) { + } else if (mq && "matchMedia" in window) { // has a mq value - return win.matchMedia(mq).matches; + return window.matchMedia(mq).matches; } return false; @@ -3524,7 +3525,7 @@ if (Tablesaw.mustard) { // run on init and resize showHideNav(); - $(win).on(Tablesaw.events.resize, showHideNav); + $(window).on(Tablesaw.events.resize, showHideNav); $table .on("tablesawcolumns.minimap", function() { @@ -3534,7 +3535,7 @@ if (Tablesaw.mustard) { var $t = $(this); tblsaw.$toolbar.find(".tablesaw-advance").remove(); - $(win).off(Tablesaw.events.resize, showHideNav); + $(window).off(Tablesaw.events.resize, showHideNav); $t.off(".minimap"); }); @@ -3632,7 +3633,7 @@ if (Tablesaw.mustard) { } }; - $(win.document).on(Tablesaw.events.create, function(e, Tablesaw) { + $(document).on(Tablesaw.events.create, function(e, Tablesaw) { if (Tablesaw.$table.is(S.selectors.init)) { S.init(Tablesaw.table); } diff --git a/package.json b/package.json index e1ec0fa..9d4299a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tablesaw", "title": "Tablesaw", "description": "A set of plugins for responsive tables.", - "version": "3.0.6", + "version": "3.0.7", "homepage": "https://github.com/filamentgroup/tablesaw", "author": { "name": "Zach Leatherman",