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

Use quotes around attribute selectors for jQuery Tabs #626

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
17 changes: 16 additions & 1 deletion src/scrollable/scrollable.js
Expand Up @@ -141,6 +141,21 @@
return self;
},

addItemBefore: function(item) {
item = $(item);

if (!conf.circular) {
itemWrap.prepend(item);
} else {
itemWrap.children("." + conf.clonedClass + ":first").after(item);
itemWrap.children("." + conf.clonedClass + ":last").replaceWith(item.clone().addClass(conf.clonedClass));
}

self.seekTo(self.getIndex() +1, 0);

fire.trigger("onAddItemBefore", [item]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the event name to "onBeforeAddItem" so that it matches the way the other events are named.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it then be OnBeforeAddItemBefore? (Event triggered before we add an item before the other scrollable items)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know what, I must have a brain freeze or something. Totally mistook this for what it actually does. Ignore my comment regarding the name change. Though I will note that because this is a new feature, it probably won't be in the next release since I'm hoping for that release to be a bug fix release only.

return self;
},

/* all seeking functions depend on this */
seekTo: function(i, time, fn) {
Expand Down Expand Up @@ -186,7 +201,7 @@
});

// callbacks
$.each(['onBeforeSeek', 'onSeek', 'onAddItem'], function(i, name) {
$.each(['onBeforeSeek', 'onSeek', 'onAddItem', 'onAddItemBefore'], function(i, name) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note as above.


// configuration
if ($.isFunction(conf[name])) {
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/tabs.js
Expand Up @@ -276,7 +276,7 @@
});

// open initial tab
if (location.hash && conf.tabs == "a" && root.find("[href=" +location.hash+ "]").length) {
if (location.hash && conf.tabs == "a" && root.find("[href='" +location.hash+ "']").length) {
self.click(location.hash);

} else {
Expand Down