Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Repeater combobox events #1816

Merged

Conversation

interactivellama
Copy link
Contributor

@interactivellama interactivellama commented May 23, 2016

Fixes #1790 for @dkilgore

pageChanged.fu.repeater should now only fire once. Repeater's pageChanged event will now return an array with a [ [pageNumber], [dataObject] ] shape.

Additional help with paging and multiple combobox events
If repeater only has two pages of data, the combobox will be present. If a 3 is entered into the combobox the data key will return the data from the combobox's changed event

{ notFound: true, text: '3'}

The 3 is not present (since there are only two pages), therefore a notFound will be present in the data returned from the combobox. A 3 (or really a zero index 2, will still be passed into the repeater, but you can now check for the notFound key in order to revert to a valid page if you so choose.

Combobox was refactored, so that that changed.fu.combobox event did not fire twice when changed after typing and then using the enter key. Issues were also present that created multiple selected menu items due to previous item with .selected class were not being removed, but still determining what item selection by a query selector for .selected:first.

Individual tests
Individual tests for combobox were not being "taken down" and therefore tests were affecting each other and not isolated. It's a noop/return if you run .combobox() on a DOM element that has already been initialized.

Please note: There are combobox tests that test events fire once, but there are no tests to check that pagechanged.fu.repeater runs once or any tests related to that event at all.

@@ -270,10 +279,13 @@
},

inputchanged: function (e, extra) {
var val = $(e.target).val();
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason you moved this above the early return?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's so that val is defined.

@futuremint futuremint merged commit 63b776e into ExactTarget:master May 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants