RCFilters: Redo the way spinners and ready/loading states are managed
authorRoan Kattouw <roan.kattouw@gmail.com>
Wed, 20 Sep 2017 00:00:24 +0000 (17:00 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Wed, 20 Sep 2017 00:07:31 +0000 (17:07 -0700)
commitbe99787e5b216247ffbc26a7f90e27ac985fff4f
tree971d96c49aa2bf5e703f25217dbfe1c3850aa3c6
parent5e7fd24297cb886f2b59a1b9c83db7e2581f31fe
RCFilters: Redo the way spinners and ready/loading states are managed

The mw-rcfilters-ui-ready class was being set on no fewer than 4 elements,
all with different meanings, and some with no relevant styling at all.
It also did not distinguish between "the UI is initializing" and
"we are loading new results".

Remove mw-rcfilters-ui-ready completely (and remove some code that added
or removed it pointlessly), and create two new CSS classes on the <body>.
mw-rcfilters-ui-initialized is added when the UI has initialized, and
is used to hide the old UI and display a spinner while the UI loads.
mw-rcfilters-ui-loading is added when we start loading new results
and removed when they arrive; it's used to grey out the results
area and add a spinner.

Bonus: make the spinner appear in a different place depending on why
it's being shown: when initializing, it's shown in the place where the
UI will soon appear; when loading, it's shown near the top of the
changes list.

Change-Id: Ib5c8a36654ba44880823fdade8cad52ffa59ed69
resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.RcTopSectionWidget.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.RcTopSectionWidget.js