gjb2048 / moodle-theme_essential

The Essential Moodle Theme
https://gjb2048.github.io/moodle-theme_essential/
GNU General Public License v3.0
91 stars 120 forks source link

Add animated Font Awesome spinner to Admin menu initial ajax open call #782

Open nadavkav opened 7 years ago

nadavkav commented 7 years ago

Some sysadmins point my attention to this, although it seems minor, as it takes seconds for it to appear.

Moodle Clean/More (and Shoelace) theme has a very informative spinner FA spinner when the Site Administration "folder" icon is clicked. (when class "loading" is present) image

gjb2048 commented 7 years ago

Code there, just not working.

gjb2048 commented 7 years ago

Ok, not working because animation 'fa-spin' and Essential's version does not work on the FA content. FA works by having a 'fa-spin' class, but this is applied to the containing tag. This is an 'i' tag. This is specified by Essential's core renderer pix_icon method. However, core Moodle AJAX does not call this when returning new 'markup', thus icon replacement not used. Essential can replace the icon in CSS but therefore not make it spin. Catch-22.

gjb2048 commented 7 years ago

No idea how to fix.

nadavkav commented 7 years ago

Tricky :cry: no idea over here too. For now, I added a half-baked workaround

.tree_item.branch.loading:before {
    font-family: FontAwesome;
    content: "\f110";
}

It starts to show the freezed "spinner" but before anyone understand what is happening... it is already loaded (ajax call returns) and it changes to "open folder" icon