From b9e7c744282cef01359bcac0b385579d9ce08ff4 Mon Sep 17 00:00:00 2001
From: Glenn Vorhes <gavorhes@wisc.edu>
Date: Wed, 22 Jun 2016 13:23:05 -0500
Subject: [PATCH] add floathead

---
 lib/collections/Sliders.js |  7 ++++-
 lib/jquery/floatthead.js   | 61 ++++++++++++++++++++++++++++++++++++++
 package.json               |  1 +
 src/collections/Sliders.js |  4 ++-
 src/jquery/floatthead.js   | 51 +++++++++++++++++++++++++++++++
 5 files changed, 122 insertions(+), 2 deletions(-)
 create mode 100644 lib/jquery/floatthead.js
 create mode 100644 src/jquery/floatthead.js

diff --git a/lib/collections/Sliders.js b/lib/collections/Sliders.js
index 3677a73..59ea2a7 100644
--- a/lib/collections/Sliders.js
+++ b/lib/collections/Sliders.js
@@ -17,6 +17,10 @@ var _jquery = require('../jquery/jquery');
 
 var _jquery2 = _interopRequireDefault(_jquery);
 
+var _makeGuid = require('../util/makeGuid');
+
+var _makeGuid2 = _interopRequireDefault(_makeGuid);
+
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -38,7 +42,8 @@ var _Slider = function () {
 
         //let _this = this;
         this.name = name;
-        this.domId = name.toLowerCase().replace(/ /g, '-');
+        // this.domId = name.toLowerCase().replace(/ /g, '-');
+        this.domId = (0, _makeGuid2.default)();
         this._weight = wgt;
         this._weightDefault = this._weight;
 
diff --git a/lib/jquery/floatthead.js b/lib/jquery/floatthead.js
new file mode 100644
index 0000000..4c79b53
--- /dev/null
+++ b/lib/jquery/floatthead.js
@@ -0,0 +1,61 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.windowScroll = windowScroll;
+exports.overflowScroll = overflowScroll;
+exports.responsiveScroll = responsiveScroll;
+/**
+ * Created by gavorhes on 6/22/2016.
+ */
+require('floatthead');
+
+/**
+ * implement the default window scroll
+ * @param {jQuery} $table - jquery reference to table
+ * @param {object} [options={}] float options
+ */
+function windowScroll($table, options) {
+    "use strict";
+
+    options = options || {};
+
+    $table.floatThead(options);
+}
+
+/**
+ *
+ * @param {jQuery} $table - jquery reference to table
+ * @param {jQuery} $tableContainer - jquery reference to table
+ * @param {object} [options={}] float options
+ */
+function overflowScroll($table, $tableContainer, options) {
+    "use strict";
+
+    options = options || {};
+
+    options.scrollContainer = function (t) {
+        return $tableContainer;
+    };
+
+    $table.floatThead(options);
+}
+
+/**
+ *
+ * @param {jQuery} $table - jquery reference to table
+ * @param {jQuery} $responsiveContainer - jquery reference to table
+ * @param {object} [options={}] float options
+ */
+function responsiveScroll($table, $responsiveContainer, options) {
+    "use strict";
+
+    options = options || {};
+
+    options.responsiveContainer = function (t) {
+        return $responsiveContainer;
+    };
+
+    $table.floatThead(options);
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index bb16133..a82af1e 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
     "babel-preset-es2015": "^6.6.0",
     "chai": "^3.5.0",
     "expect": "^1.20.1",
+    "floatthead": "^1.4.0",
     "jasmine": "^2.4.1",
     "jasmine-core": "^2.4.1",
     "karma": "^0.13.22",
diff --git a/src/collections/Sliders.js b/src/collections/Sliders.js
index 04e7757..ffb97b3 100644
--- a/src/collections/Sliders.js
+++ b/src/collections/Sliders.js
@@ -4,6 +4,7 @@
 import provide from '../util/provide';
 let nm = provide('collections');
 import $ from '../jquery/jquery';
+import makeGuid from '../util/makeGuid';
 
 class _Slider {
 
@@ -17,7 +18,8 @@ class _Slider {
     constructor(name, selections, wgt, selected) {
         //let _this = this;
         this.name = name;
-        this.domId = name.toLowerCase().replace(/ /g, '-');
+        // this.domId = name.toLowerCase().replace(/ /g, '-');
+        this.domId = makeGuid();
         this._weight = wgt;
         this._weightDefault = this._weight;
 
diff --git a/src/jquery/floatthead.js b/src/jquery/floatthead.js
new file mode 100644
index 0000000..d0d0bc0
--- /dev/null
+++ b/src/jquery/floatthead.js
@@ -0,0 +1,51 @@
+/**
+ * Created by gavorhes on 6/22/2016.
+ */
+require('floatthead');
+
+
+/**
+ * implement the default window scroll
+ * @param {jQuery} $table - jquery reference to table
+ * @param {object} [options={}] float options
+ */
+export function windowScroll($table, options){
+    "use strict";
+    options = options || {};
+
+    $table.floatThead(options);
+}
+
+/**
+ *
+ * @param {jQuery} $table - jquery reference to table
+ * @param {jQuery} $tableContainer - jquery reference to table
+ * @param {object} [options={}] float options
+ */
+export function overflowScroll($table, $tableContainer, options){
+    "use strict";
+    options = options || {};
+
+    options.scrollContainer = (t) => {
+        return $tableContainer;
+    };
+
+    $table.floatThead(options);
+}
+
+/**
+ *
+ * @param {jQuery} $table - jquery reference to table
+ * @param {jQuery} $responsiveContainer - jquery reference to table
+ * @param {object} [options={}] float options
+ */
+export function responsiveScroll($table, $responsiveContainer, options){
+    "use strict";
+    options = options || {};
+
+    options.responsiveContainer = (t) => {
+        return $responsiveContainer;
+    };
+
+    $table.floatThead(options);
+}
-- 
GitLab