Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

filter widget - first commit #6145

Merged
merged 13 commits into from
Jul 25, 2013
Merged

filter widget - first commit #6145

merged 13 commits into from
Jul 25, 2013

Conversation

frequent
Copy link
Contributor

@frequent frequent commented Jul 9, 2013

@uGoMobi, @arschmitz

Through with testing. Everything passes on my machine (tested functions on FF, Chrome, IE8 so far Qunit on FF, Chrome)

Some notes:

  • Latest demo here
  • I have not removed any of the listview filter extension files
  • Tests: I sporadically get an error self._getFilterableItems() is not defined. Still chasing this, but makes no sense to me, as it's defined in the function preceding the function that calls it.
  • Tests: As the filter now has a 300ms delay (option?), I needed to setTimeout quite a bit in the tests. If that's not the way to go, let me know and I will amend.
  • Tests: I tested ul, table, div, controlgroup, select, p, span. Any others I should add and all else, please also let me know.

@arschmitz
Copy link
Contributor

Thanks @frequent ill look at this tonight.

@jaspermdegroot
Copy link
Contributor

Awesome! Thanks a lot @frequent !

@frequent
Copy link
Contributor Author

frequent commented Jul 9, 2013

@uGoMobi, @arschmitz
I just saw I still need to jslint/jshint. Which one are you using and are there some default "rules" applied? Will do tomorrow.

@gseguin
Copy link
Contributor

gseguin commented Jul 9, 2013

@frequent We use jshint. Rules are in https://github.com/jquery/jquery-mobile/blob/master/js/.jshintrc. At the command line just type: grunt lint

@jaspermdegroot
Copy link
Contributor

define( [ "jquery", "./forms/textinput" ], function( jQuery ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
"use strict";
Copy link
Contributor

Choose a reason for hiding this comment

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

No "use strict" in client code.

},

_onKeyUp: function() {
var self = this,
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to use self here just use this all the way down. self is generally not a needed concept in widgets since the this reference is maintained for events and setTimeout by using widget methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replaced all self

@jzaefferer
Copy link
Contributor

Shouldn't you add a demo that shows how to use this filterbar together with listview?

@jzaefferer
Copy link
Contributor

It really helps to reference issues in commit messages and PRs. This PR fixes #5629

@frequent
Copy link
Contributor Author

@jzaefferer, @arschmitz
thanks for feedback.
I added a demo link in the PR comment above. Here it is again: Demo. The other points I will try to fix tonight.

@jzaefferer
Copy link
Contributor

@frequent I meant demos inside this repo. At least a visual test. Something that other contributors will see in the future, once this PR is closed.

@frequent
Copy link
Contributor Author

@jzaefferer
Do you mean "demo-demos" like in demos? If so, will try to fit in a few hours tomorrow to add those.

And pardon for the missed fix mention.

var o = this.options,
wrapper = document.getElementById( "ui-filter-" + this.uuid );

if ( o.enhanced === false ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just use if ( !o.enhanced ) {

@jzaefferer
Copy link
Contributor

Regarding demos: Yes, exactly.

@frequent
Copy link
Contributor Author

@uGoMobi, @arschmitz:

If you want to help out:

  • I'm stuck on this test Native Select Search Filter - using data-filtertext, which passes no problem on my machine, but fails in Travis. Maybe you see something I don't.

@gabrielschulhof gabrielschulhof merged commit c35285e into jquery-archive:master Jul 25, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants