settings: Extract admin_sections.maybe_disable_widgets().

We now run the code to disable widgets every time
we reload a section, which was the original intention
of the code, but the call to it only happened when
you first launched the page.

We also continue to run this logic for live updates
of is_admin, although it's worth noting that the
code still only handles the "demotion" case of going
from admin to non-admin. (If somebody makes you an
admin, you continue to need to reload to get
widgets enabled.)
This commit is contained in:
Steve Howell
2018-12-06 17:23:57 +00:00
committed by Tim Abbott
parent a0dbcde063
commit 1d07d0a532
4 changed files with 32 additions and 15 deletions

View File

@@ -9,6 +9,9 @@ set_global('activity', {
set_global('settings_users', {
update_user_data: function () {},
});
set_global('admin_sections', {
maybe_disable_widgets: function () {},
});
set_global('admin', {
show_or_hide_menu_item: function () {},
});