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

wysihtml5 integration possible? #452

Closed dgilperez closed 9 years ago

dgilperez commented 9 years ago

Hi!

I'd like to know if it is possible to use best_in_place with Wyshtml5 editor. I'm using this rails-ready version: https://github.com/Nerian/bootstrap-wysihtml5-rails Has anyone got this working?

Thanks!

dgilperez commented 9 years ago

I've been playing a while with this, and I almost got it working. The only culprit was that I got the inputBlurHandler called when it should not: as long as the wysihtml5 works by hiding the textarea and showing an iframe with the actual controls and input, the textarea was detected as blurred, what in turn triggered an abort operation just after the field was activated.

I solved this locally by adding an extra skip_blur option to the helper, acting as a flag to control the inputBlurHandler trigger in the js code. I'm not sure if this is the best approach or if you will accept a PR in this direction. I'd love to hear your thoughts.

stereodenis commented 9 years ago

@seuros what do you think about this flag?

dgilperez commented 9 years ago

Just wanted to confirm I'm using this approach in production without any issue. You can use my fork while this thing is sorted out here: dgilperez/best_in_place

stereodenis commented 9 years ago

@dgilperez our master is newer than yours could you test your fork here? https://travis-ci.org/dgilperez/best_in_place

dgilperez commented 9 years ago

@stereodenis rebased against master, tested and green!

https://travis-ci.org/dgilperez/best_in_place/builds/55402062

seuros commented 9 years ago

Where is the PR ?

dgilperez commented 9 years ago

I was waiting for your feedback on this before sending you a PR, but there you go: https://github.com/bernat/best_in_place/pull/462

stevenspiel commented 8 years ago

Can you add documentation outlining implementation details?