diff --git a/lib/collections/Sliders.js b/lib/collections/Sliders.js index 3677a73b984867713aab5cb7347c1d6b06ffeabe..59ea2a793ec29e8187a29a26d7a3e8824d407348 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 0000000000000000000000000000000000000000..4c79b5368e71422ef061f9ff9610a6aa78808866 --- /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 bb1613375765a4702c0e1db7148913eb4dcf61fa..a82af1edf724f62095c46d227df90e6581dda1b1 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 04e7757f6483964bd977d81e8d068a5b24ce02fc..ffb97b3012921ffda521909461e0eda7a577983b 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 0000000000000000000000000000000000000000..d0d0bc04518cfd85aedbc0c742ecf83a36850c12 --- /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); +}