Skip to content

Commit

Permalink
Merge pull request jmosbech#88 from mitermayer/master
Browse files Browse the repository at this point in the history
Tinymce/Iframe support - Adding options to allow users to overwritte window, document and head
  • Loading branch information
jmosbech committed May 21, 2015
2 parents 8ed1da3 + f2c77b0 commit e764277
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions js/jquery.stickytableheaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
fixedOffset: 0,
leftOffset: 0,
marginTop: 0,
objDocument: document,
objHead: 'head',
objWindow: window,
scrollableArea: window
};

Expand All @@ -22,8 +25,6 @@
base.$el = $(el);
base.el = el;
base.id = id++;
base.$window = $(window);
base.$document = $(document);

// Listen for destroyed, call teardown
base.$el.bind('destroyed',
Expand All @@ -40,6 +41,8 @@
base.topOffset = null;

base.init = function () {
base.setOptions(options);

base.$el.each(function () {
var $this = $(this);

Expand All @@ -61,10 +64,9 @@
'.tableFloatingHeader{display:none !important;}' +
'.tableFloatingHeaderOriginal{position:static !important;}' +
'</style>');
$('head').append(base.$printStyle);
base.$head.append(base.$printStyle);
});

base.setOptions(options);
base.updateWidth();
base.toggleHeaders();
base.bind();
Expand Down Expand Up @@ -251,8 +253,11 @@

base.setOptions = function (options) {
base.options = $.extend({}, defaults, options);
base.$window = $(base.options.objWindow);
base.$head = $(base.options.objHead);
base.$document = $(base.options.objDocument);
base.$scrollableArea = $(base.options.scrollableArea);
base.isWindowScrolling = base.$scrollableArea[0] === window;
base.isWindowScrolling = base.$scrollableArea[0] === base.$window[0];
};

base.updateOptions = function (options) {
Expand Down

0 comments on commit e764277

Please sign in to comment.