Comments (8)
Showing just a single class is actually intentional. Class names are explained in the wiki. However, I appear to have left out the part about selectors (oops!).
I'm happy to change this functionality to bind both classes because it seems like people aren't used to the class structure and I'm not trying to introduce any new CSS concepts here. Ultimately, that would also remove the className
property, which is a little confusing when compared to classNames
, etc. Overall, a good move.
from ember-flash-messages.
Sorry, but I'm a bit confused. In the wiki chapter about the component class-name you state that a message with type: 'success'
and className: 'alert'
will have the following class names:
<dl class=".alert .alert-success"></dl>
Im my hands, it returns only the following class:
<dl class=".alert-success"></dl>
And this despite the right classNameBindings: ['className', 'typeClass', 'visible']
call.
And yes, switching from className to classNames would be great.
from ember-flash-messages.
Ah, you are correct - apologies. That's definitely a bug then. I can't look into it right now but will get a patch up by the weekend. Of course I'll accept a PR too if you are able to get one up sooner.
from ember-flash-messages.
Well, I'm not sure the bug is coming from your part. I'm if this is not coming from Ember #classNameBindings itself when a two classNames start with the same string. I'll try to verify this.
from ember-flash-messages.
Ok, I've found some time to look over it at lunch. Will report back shortly.
from ember-flash-messages.
The issue seems to lie in non-static messages. Static messages shown using the component (whether a block component or otherwise) have the correct class names (.flash_message .flash_message-success
).
Both of the following work:
{{#flash-message type='hello'}}
Testing block content {{#link-to 'index'}}and Handlebars{{/link-to}}
{{/flash-message}}
{{flash-message type='success' content='what?'}}
However, when the message is added to the queue, only the typeClass
class name is present (.flash_message-success
).
The key difference between the messages is that non-static messages are rendered in the message-queue.hbs
template using the message
property. The root of this issue in using the message
property and the _setMessageProperties
method of the flash message component.
Passing in type and content separately works as expected:
{{flash-message message=currentMessage}}{{!--Does not work--}}
{{flash-message content=currentMessage.content type=currentMessage.type}}{{!--Works--}}
I'll have a PR up to fix within the hour.
from ember-flash-messages.
The fix is a little more in depth than first thought because it's affecting the queues. I have a fix underway though.
from ember-flash-messages.
Resolved by #17 - thanks for your patience.
from ember-flash-messages.
Related Issues (16)
- missing import of 'Em' HOT 6
- Notify not showing up HOT 5
- DEPRECATION warning HOT 2
- Remove jquery dependency HOT 1
- Ember warning after message removed from queue HOT 1
- Install fails HOT 12
- Install conflict with ember-cli-list-view HOT 1
- Async test helpers waiting forever HOT 7
- dismiss message on transition HOT 2
- Refactor as a service HOT 2
- Message object initiation HOT 1
- Specify template as "content' in JS API HOT 3
- Override flash-message template HOT 1
- Error: Attempting to inject an unknown injection: `service:flashMessageQueue` HOT 4
- Class names use underscores in css but dashes in HTML
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-flash-messages.