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

refactor(tables): update tables - INNO-517 #148

Merged
merged 3 commits into from
May 30, 2017
Merged

Conversation

emeryro
Copy link
Contributor

@emeryro emeryro commented May 29, 2017

Tables updated from DTT implementation (no DT specifications).
Responsive display is managed both by javascript and css (javascript converted from jquery to vanilla).

Code should probably be optimized in the future (once we have real specifications)

@kalinchernev kalinchernev self-assigned this May 29, 2017
Copy link
Contributor

@kalinchernev kalinchernev left a comment

Choose a reason for hiding this comment

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

The markup is better, cleared.
The js part works without any problems. (I don't have IE locally though)
Maybe a small example would be useful for people who don't know the details of calling a method of Europa module:

/**
 * @file
 * Example of using responsive table from ECL.
 * You do not need jQuery.
 */

(function () {
  Drupal.behaviors.ECL = {
    attach: function (context, settings) {
      Europa.eclTables();
    }
  };
}());

Good improvements!

*/

// eslint-disable-next-line import/prefer-default-export
export function eclTables() {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you want to apply this transformation not on all tables but only on a subset? My two cents: you could add an optional parameter eclTables(elements = null) and then reuse it const tables = elements === null ? document.getElementsByClassName('ecl-table') : elements;. Or you could pass the the query selector and then call querySelectorAll instead of getElementsByClassName :)

Copy link
Contributor Author

@emeryro emeryro May 30, 2017

Choose a reason for hiding this comment

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

It may be an improvement.
Anyway, the code will have to be updated, as now it isn't optimal (too many DOM browsing that should be put in variables).
I'd say, we merge the branch as is, and we create a ticket for this, with your comment (and Kalin's remark too). If we have time to deal with it before thursday, great, in not we have at least something working.

Copy link
Contributor

Choose a reason for hiding this comment

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

Solution: we create a follow-up ticket and merge this PR.

@yhuard yhuard merged commit 46248ff into master May 30, 2017
@yhuard yhuard deleted the refactor/tables-INNO-517 branch May 30, 2017 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants