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

prevent jqmData calls for columns without a priority #7315

Closed
wants to merge 1 commit into from
Closed

prevent jqmData calls for columns without a priority #7315

wants to merge 1 commit into from

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 14, 2014

No description provided.

@@ -85,9 +85,10 @@ $.widget( "mobile.table", $.mobile.table, {
this.headers.not( "td" ).each( function() {
var header = $( this ),
priority = $.mobile.getAttribute( this, "priority" ),
cells = header.add( header.jqmData( "cells" ) );
cells;
Copy link
Contributor

Choose a reason for hiding this comment

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

Variables which are not assigned should be comma separated on the first line with assigned ones each on their own line after.

@arschmitz
Copy link
Contributor

Thanks for taking the time to contribute to jQuery Mobile. We have the following requirements of pull requests before we can review them.

  • Sign our CLA.
  • A ticket with a reduced test case must be created and verified by the team.
  • Include a unit test to ensure the fix works and prevent against regressions.
  • Ensure code adheres to our style guide.
  • Ensure commit messages adhere to our commit message style guide.

If you are interested in continuing with this change, please correct the remaining items and we will look into this for you.

@staabm
Copy link
Contributor Author

staabm commented Apr 24, 2014

Cs fixed, thanks.

The fix does not change behavior, fix a bug or or add a new feature. Therefore I am not sure, whether a unit test or testcase is required.

Its more like a trivial performance fix.

@staabm
Copy link
Contributor Author

staabm commented Apr 24, 2014

In case you agree, i would squash the commits and fix the commit message

var header = $( this ),
priority = $.mobile.getAttribute( this, "priority" ),
cells = header.add( header.jqmData( "cells" ) );
var header = $( this ), cells,
Copy link
Contributor

Choose a reason for hiding this comment

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

cells should be on the first line by it self see http://contribute.jquery.org/style-guide/js/#assignments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, thanks

@arschmitz
Copy link
Contributor

Normally I would like to see a check to make sure we are not assigning this if its not needed however the way the code here works there is no way to check this so no need for a unit test you are correct. We would like to still see an issue so that it can be referenced from this PR and give it a chance for people to comment on it if they would like but no test case is needed.

@staabm
Copy link
Contributor Author

staabm commented Apr 25, 2014

What do you mean by "we want to see an issue"? Should I provide a jsfiddle with a patched jquery mobile version and a usage sample? Or do you mean I need to create a issue in some sort of external issue tracker?

@gabrielschulhof
Copy link

@staabm Please file an issue at https://github.com/jquery/jquery-mobile/issues/new, then modify the commit message to end with the line
Fixes gh-nnnn

where nnnn is the number of the issue you've filed.

@staabm
Copy link
Contributor Author

staabm commented May 1, 2014

Not sure why we need another issue, but here it is
#7357

I will adjust the commit message when I am back at my pc tomorrow

@gabrielschulhof
Copy link

@staabm Thanks a lot!

@staabm
Copy link
Contributor Author

staabm commented May 2, 2014

Commits squashed and message adjusted. Hopefully I matched your commit style :-).

@gabrielschulhof
Copy link

It still needs a unit test to make sure that $.fn.jqmData() is not called on columns that have no priority. You could instrument $.fn.jqmData() and then check under what circumstances and with what parameters it gets called.

@arschmitz arschmitz closed this in ded2f7f Jun 2, 2014
arschmitz pushed a commit that referenced this pull request Jun 3, 2014
agcolom pushed a commit to agcolom/jquery-mobile that referenced this pull request Nov 26, 2014
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.

None yet

3 participants