vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

Add class when xeditable is disabled #591

Closed MooDySmiles closed 7 years ago

MooDySmiles commented 7 years ago

Hi!

Is it possible to add a "disabled" css class to the Xeditable element (when it is disabled)? It would be really helpful to have a css class like that in order to adjust the appearance of the element.

Right now the style is the same, whenever it is enabled or disabled.

ckosloski commented 7 years ago

It's possible. Do you need the styles to dynamically change between enabled/disabled?

MooDySmiles commented 7 years ago

Yes, something like "editable-disabled" to be added runtime when edit-disable="true" and to be removed when edit-disable="false"

ckosloski commented 7 years ago

I tried watching the editable-disabled attribute and changing the classes, but I couldn't get it to work right. I could give you a one time shot css when the element is loaded the first time. Or, you could add some styling yourself by adding a class based upon the same criteria you are using for the editable-disabled attribute.

MooDySmiles commented 7 years ago

It's pretty useless for us give it css when the element is loaded the firts time. Right now it isn't a fundamental feature, so we'll work on it when we'll have the time.

Thanks for your time! :smiley:

ckosloski commented 7 years ago

@MooDySmiles did you figure out a fix for this?

MooDySmiles commented 7 years ago

@ckosloski we hacked that by placing a span (with ngIf) when we want xeditable to be disabled. We have been moved onto a new whole project, so I don't think we will be able to do any progress on this, sorry :disappointed:

ckosloski commented 7 years ago

@MooDySmiles Do you want to close this issue then?

MooDySmiles commented 7 years ago

If it's okay for you, it's okay for me.