recurring_select icon indicating copy to clipboard operation
recurring_select copied to clipboard

recurring link

Open dquimper opened this issue 11 years ago • 4 comments

Hi,

I'm trying to make a link that would display the recurring popup.

Something like

= f.hidden_field :recurring_rule
%span#translation_span
= link_to_function("Repeat", "display_recurring_popup('#model_recurring_rule', '#translation_span');")

Where #model_recurring_rule is the DOM id of the hidden field where I want the rule's hash to be stored and #translation_span is the DOM id of a tag where I want to display the translation (ie: "Every 3 days").

Any hint on how I can do this? Once I succeed, I'll be happy to make a pull request if you liked.

Thanks

dquimper avatar Dec 19 '13 06:12 dquimper

RecurringSelect is pretty tightly tied into the select field. I'm not sure how successful removing it entirely will be.

If you really wanted to not show a select field, and use a link to open the menu, I would probalby use a hack. Try setting the select style to height 1px, width 1px, border none, background transparent. Then use the link to focus the select field.

forrest avatar Dec 19 '13 16:12 forrest

:+1: Great gem, so thanks for sharing!

I tend to agree that restricting the UI element to a select tag is an unexpected constraint. Would be nice to customize UI by providing a more exposed javascript interface for displaying the dialog and handling associated event callbacks.

findchris avatar Feb 11 '14 14:02 findchris

Hi, I worked on a fork of the gem at https://github.com/instedd/recurring_select/tree/recurring_link in order to support a link with hidden input. I also did some other changes to show the dialog right below the link instead of a popup. And finally a helper to support storing the recurrence in a easier way. All this in different branches at the fork. Will try to submit pull request during the week, but in case I don't here is the heads up.

Awesome gems!

bcardiff avatar Apr 18 '14 23:04 bcardiff

:+1: Nice @bcardiff. I'd love to see this make it into a pull request.

findchris avatar Apr 18 '14 23:04 findchris