-
Notifications
You must be signed in to change notification settings - Fork 75
Icon helper #14
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
Icon helper #14
Conversation
|
@claudiofullscreen this is supports everything that used to work and unified The only problem is that in Don't really know how to fix that without having some config var for that. |
lib/bh/helpers/icon_helper.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮 I didn't know font awesome had more options!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmh… I need to take a look at those options! It's a good idea to add them, but I still wouldn't want the code to be too specific to Font Awesome.
For instance, if someone writes
<%= icon :heart, library: :glyphicons, size: 3 %>I wouldn't mind displaying <span class="glyphicon glyphicon-zoom-in glyphicon-3x"></span> even if that class does not have a meaning for glyphicon.
At least there would be more consistency in the helper, and less library-specific options.
I'll have to look up those options!
|
@buren As I said in the comment to your other PR, there is no need to customize the error icon. That helper is there to show a red "X" at the right of an invalid field… it's a fixed universally recognized symbol to display that something is wrong, so I don't think that's something that needs to be customizable. If it was, then someone might argue that the symbol itself should be customizable: instead of showing an "X" someone would want to show a telephone… I don't think it's worth going there. Once again, whenever you have Bootstrap CSS, you do have that "X" symbol, so we can just use that. |
lib/bh/helpers/icon_helper.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line is superfluous…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which lines? 22-25?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, just line 30…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean, how would you want it?
|
OK. I have nothing to add beyond what is in this pull request. Is there anything you think is missing? |
lib/bh/helpers/icon_helper.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I thought the same… actually I would just go with options[:library].to_s so you can also catch font_awesome… or even better, since ActiveSupport is already required, you can call .underscore, so all the variants are transformed into font_awesome
|
I think this PR looks really solid now (I have added my last comments to the code). I have to go through and learn a little more about Font Awesome (to make sure it does not clash with Glyphicons), but in general I would say 👍 |
lib/bh/helpers/icon_helper.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I read your case statement correctly, it says
case options.delete(:library)
when :font_awesome, 'font-awesome' then :fa
else options[:library]
:glyphicon
endSo I have a feeling that when the else statement is reached, then :glyphiconis always returned, rather than options[:library].
Maybe it's just me reading the code on GitHub…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No thats my bad! Its getting a little late for my eyes I guess...
|
Added the |
|
wait found one little problem, fixing it |
|
Ah, don't worry! I'm not in a hurry. Also, if you plan to use this new feature in a project of yours, go on and link the Gemfile to your own branch, so you can try it a little more on a real application, and give me your impressions! |
|
Absolutely! Im thinking of just aliasing the |
|
I went ahead and used |
|
Mmmh… no, I'd rather have Anyway… don't worry too much about these details! I'll review it all and On Thu, Sep 11, 2014 at 5:36 PM, Jacob Burenstam notifications@github.com
Claudio Baccigalupo | Software Writer | Fullscreen, Inc. |
* Works with both Glyphicon and Font Awesome * Removed FontAwesome and Glyphicon Helper * 100% backward compatible
|
@claudiofullscreen https://github.com/buren/bh/tree/additional-components adds support for |
|
@buren 😮 I don't know how to thank you!! 👍 I'm going to go and read through those commits as soon as I can! |
|
Closing this favouring: #16 |
IconHelperFontAwesomehelperGlyphiconhelper