mirror of
https://github.com/discourse/discourse.git
synced 2024-12-13 19:43:52 +08:00
56524f4bdf
Very similar to move up/down flag problem fixed here - https://github.com/discourse/discourse/pull/28272 Those are the steps to toggle the flag: 1. click toggle - `saving` CSS class is added; 2. request to backend; 3. `saving` CSS class is removed. And check if the flag was toggle was: ```ruby def has_saved_flag?(key) has_css?(".admin-flag-item.#{key}.saving") has_no_css?(".admin-flag-item.#{key}.saving") end ``` If the save action is very fast, then the saving class is removed before the first check. Therefore I decided to invert it, and once action is finished add `saved` CSS class. Then we can have a quick positive check: ```ruby def has_saved_flag?(key) has_css?(".admin-flag-item.#{key}.saved") end ``` |
||
---|---|---|
.. | ||
about.rb | ||
admin_about_config_area.rb | ||
admin_customize_themes.rb | ||
admin_dashboard_new_features.rb | ||
admin_flag_form.rb | ||
admin_flags.rb | ||
admin_objects_theme_setting_editor.rb | ||
admin_site_settings.rb | ||
admin_staff_action_logs.rb | ||
admin_user_fields.rb | ||
admin_watched_words.rb | ||
admin_web_hook_events.rb | ||
base.rb | ||
category.rb | ||
csv_export_pm.rb | ||
discovery.rb | ||
form_template.rb | ||
group_activity_posts.rb | ||
group.rb | ||
header.rb | ||
review.rb | ||
search.rb | ||
tag.rb | ||
topic.rb | ||
user_notifications.rb | ||
user_preferences_account.rb | ||
user_preferences_interface.rb | ||
user_preferences_navigation_menu.rb | ||
user_preferences_profile.rb | ||
user_preferences_security.rb | ||
user_preferences.rb | ||
user_private_messages.rb | ||
user_reset_password.rb | ||
user.rb | ||
wizard.rb |