Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new setting for the fakeheader class #2

Merged
merged 1 commit into from
Aug 23, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions jquery.list.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
// These will be stored in $this.data(plugin_name).settings,
// and can be overwritten by having 'options' passed through
// as the parameter to the init method.
var defaults = {
headerSelector : 'dt',
zIndex : 1
};
var defaults = {
headerSelector : 'dt',
zIndex : 1,
fakeHeaderClass : 'ui-' + plugin_name + '-fakeheader'
};

var scrollTimeout = null;

Expand Down Expand Up @@ -53,7 +54,7 @@
updateHeader: function(target, newHeader) {
var data = target.data(plugin_name);
if (data) {
data.fakeHeader = newHeader.clone().removeAttr('id').addClass('-' + plugin_name + '-fakeheader');
data.fakeHeader = newHeader.clone().removeAttr('id').addClass(data.settings.fakeHeaderClass);
data.fakeHeader.css({
position: 'absolute',
top: 0,
Expand Down Expand Up @@ -224,7 +225,7 @@

// Grab some variables to set up the list.
data.headers = $this.find(data.settings.headerSelector);
data.fakeHeader = data.headers.eq(0).clone().removeAttr('id').addClass('-'+plugin_name+'-fakeheader');
data.fakeHeader = data.headers.eq(0).clone().removeAttr('id').addClass(data.settings.fakeHeaderClass);

// bind a scroll event and change the text of the fake heading
data.wrapper.bind('scroll.'+plugin_name,$.proxy(_private.events.scroll,$this)).css({
Expand Down