简体   繁体   中英

Finding all active in place editors

I have an existing rails form with many sections that can be edited in place, using in_place_editor. Now I need to detect if any of the in place forms are visible, ie, the user is editing a section, before navigating away from the page. What's the usual "rails way" of doing this?

Turns out this was fairly easy during the light of day and some extra coffee:

jQuery(".form:visible").length > 0

did the trick. All the forms in question had the class `.form'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM