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

Support custom icon classes #29

Closed
zavan opened this issue Nov 5, 2015 · 4 comments
Closed

Support custom icon classes #29

zavan opened this issue Nov 5, 2015 · 4 comments
Assignees

Comments

@zavan
Copy link

zavan commented Nov 5, 2015

I'd like to use FontAwesome instead of Glyphicons to provide the icons, but this is not possible since icon classes are writen directly in the component template. I suggest we should be able to do something like:

icons = {
  sortAsc: 'fa fa-sort-asc',
  sortDesc: 'fa fa-sort-desc'
}
{{models-table customIcons=icons}}

But of course, keeping Glyphicons as the default.

@zavan
Copy link
Author

zavan commented Nov 5, 2015

If anyone is interested, right now I'm "aliasing" FA icons to glyphicons:

span.glyphicon.glyphicon-triangle-bottom:before {
  content: "\f150";
  font-family: FontAwesome;
}

span.glyphicon.glyphicon-triangle-top:before {
  content: "\f151";
  font-family: FontAwesome;
}

span.glyphicon.glyphicon-check:before {
  content: "\f046";
  font-family: FontAwesome;
}

span.glyphicon.glyphicon-unchecked:before {
  content: "\f096";
  font-family: FontAwesome;
}

span.glyphicon.glyphicon-chevron-left:before {
  content: "\f053";
  font-family: FontAwesome;
}

span.glyphicon.glyphicon-chevron-right:before {
  content: "\f054";
  font-family: FontAwesome;
}

span.glyphicon.glyphicon-menu-left:before {
  content: "\f060";
  font-family: FontAwesome;
}

span.glyphicon.glyphicon-menu-right:before {
  content: "\f061";
  font-family: FontAwesome;
}

You can get the "content" unicode for the icons here.

@listepo
Copy link
Contributor

listepo commented Nov 5, 2015

@zavan you can extend ember-models-table http://stackoverflow.com/questions/28654662/how-to-extend-an-ember-cli-addon and use any icons and classes :)

@arthur-s
Copy link

arthur-s commented Nov 7, 2015

@listepo, @onechiporenko, @zavan I edited this module to Pure.css and FontAwesome
https://github.com/arthur-s/ember-models-table
without tests

@onechiporenko onechiporenko self-assigned this Nov 7, 2015
onechiporenko pushed a commit that referenced this issue Nov 8, 2015
@onechiporenko
Copy link
Owner

customIcons-option is added
Usage:

{{models-table data=data columns=columns customIcons=customIcons}}

customIcons:

customIcons = {
    'sort-asc': 'class-sort-asc',
    'sort-desc': 'class-sort-desc',
    'column-visible': 'class-column-visible',
    'column-hidden': 'class-column-hidden',
    'nav-first': 'class-nav-first',
    'nav-prev': 'class-nav-prev',
    'nav-next': 'class-nav-next',
    'nav-last': 'class-nav-last'
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants