bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 572 forks source link

Placeholder element class for style #461

Closed soberstadt closed 8 years ago

soberstadt commented 9 years ago

It would be really great to be able to style the span tags based on if the span was built and contains the placeholder text or not. Maybe something like bip-placeholder.

My idea is to be able to style placeholders as grey text.

Would that be something you would be willing to add or accept a PR?

stereodenis commented 9 years ago

@soberstadt there is an option :place_holder

Options:
...
:place_holder: The nil param defines the content displayed in case no value is defined for that field. It can be something like "click me to edit". If not defined it will show "-".
soberstadt commented 9 years ago

Sorry, maybe I didn't make myself clear.

We are currently using the place_holder option to provide placeholder text. But what I would like to do is use css to give those using the placeholder text a different style. So I could do something like this: screen shot 2015-03-22 at 5 45 10 pm

My thought is that this css class could be added on the js side and then removed once it's updated through successful update.

Does that make better sense?

stereodenis commented 9 years ago

@soberstadt ok. I will take a look on it

soberstadt commented 9 years ago

Thanks!

stereodenis commented 9 years ago

@seuros need feature label