forgejo/web_src/js
wxiaoguang 0bc8bb3cc4
Make issue meta dropdown support Enter, confirm before reloading ()
As the title. Label/assignee share the same code.

* Close 
* Close 

Also:

* partially fix for , now the comment reaction and menu work with
keyboard.
* partially fix for , in most cases the comment won't be lost.
* partially fix for 
* partially fix for 
* partially fix for 

### The `Enter` support

Before, if user presses Enter, the dropdown just disappears and nothing
happens or the window reloads.

After, Enter can be used to select/deselect labels, and press Esc to
hide the dropdown to update the labels (still no way to cancel ....
maybe you can do a Cmd+R or F5 to refresh the window to discard the
changes .....)


This is only a quick patch, the UX is still not perfect, but it's much
better than before.


### The `confirm` before reloading

And more fixes for the `reload` problem, the new behaviors:

* If nothing changes (just show/hide the dropdown), then the page won't
be reloaded.
* If there are draft comments, show a confirm dialog before reloading,
to avoid losing comments.

That's the best effect can be done at the moment, unless completely
refactor these dropdown related code.

Screenshot of the confirm dialog:

<details>


![image](https://user-images.githubusercontent.com/2114189/220538288-e2da8459-6a4e-43cb-8596-74057f8a03a2.png)

</details>

---------

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-24 09:26:27 +08:00
..
components Add force_merge to merge request and fix checking mergable () 2023-02-21 08:42:07 -06:00
features Make issue meta dropdown support Enter, confirm before reloading () 2023-02-24 09:26:27 +08:00
markup Move helpers to be prefixed with gt- () 2023-02-13 17:59:59 +00:00
modules Add Mermaid copy button, avoid unnecessary tooltip hide () 2022-12-25 18:17:48 +01:00
standalone Add new JS linter rules () 2021-11-22 16:19:01 +08:00
test Use link in UI which returned a relative url but not html_url which contains an absolute url () 2023-02-06 12:09:18 -06:00
utils Fix the show/hide methods for string selector () 2023-02-21 11:09:03 -06:00
webcomponents Introduce customized HTML elements, fix incorrect AppUrl usages in templates () 2023-02-17 22:02:20 +08:00
bootstrap.js Quick fixes monaco-editor error: "vs.editor.nullLanguage" () 2022-11-09 18:02:19 +08:00
index.js Improve AppUrl/ROOT_URL checking () 2023-02-09 11:14:45 -05:00
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations () 2020-04-18 18:46:29 -04:00
serviceworker.js Fix serviceworker output file and misc improvements () 2020-05-24 08:36:40 +01:00
svg.js Implement actions () 2023-01-31 09:45:19 +08:00
svg.test.js Remove vitest globals () 2022-10-19 14:50:19 +08:00
utils.js Scoped labels () 2023-02-18 21:17:39 +02:00
utils.test.js Fix links for the menus in the view file page () 2023-02-08 00:08:44 +08:00