mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-48044 mod_forum: Preload icons for discussion subscription toggles
This commit is contained in:
parent
1d9155872f
commit
548453ecde
3 changed files with 25 additions and 1 deletions
|
@ -245,6 +245,7 @@
|
|||
forum_get_discussion_subscription_icon($forum, $post->discussion, null, true),
|
||||
'discussionsubscription'
|
||||
);
|
||||
echo forum_get_discussion_subscription_icon_preloaders();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3819,6 +3819,19 @@ function forum_get_discussion_subscription_icon($forum, $discussionid, $returnur
|
|||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a pair of spans containing classes to allow the subscribe and
|
||||
* unsubscribe icons to be pre-loaded by a browser.
|
||||
*
|
||||
* @return string The generated markup
|
||||
*/
|
||||
function forum_get_discussion_subscription_icon_preloaders() {
|
||||
$o = '';
|
||||
$o .= html_writer::span(' ', 'preload-subscribe');
|
||||
$o .= html_writer::span(' ', 'preload-unsubscribe');
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the drop down that allows the user to select how they want to have
|
||||
* the discussion displayed.
|
||||
|
@ -5382,7 +5395,9 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions = -1, $
|
|||
echo '<th class="header lastpost" scope="col">'.get_string('lastpost', 'forum').'</th>';
|
||||
if (has_capability('mod/forum:viewdiscussion', $context)) {
|
||||
if (\mod_forum\subscriptions::is_subscribable($forum)) {
|
||||
echo '<th class="header discussionsubscription" scope="col"> </th>';
|
||||
echo '<th class="header discussionsubscription" scope="col">';
|
||||
echo forum_get_discussion_subscription_icon_preloaders();
|
||||
echo '</th>';
|
||||
}
|
||||
}
|
||||
echo '</tr>';
|
||||
|
|
|
@ -148,6 +148,14 @@ span.unread {
|
|||
width: 12px;
|
||||
}
|
||||
|
||||
.path-mod-forum .preload-subscribe {
|
||||
background: url([[pix:mod_forum|t/subscribed]]) no-repeat -9999px -9999px;
|
||||
}
|
||||
|
||||
.path-mod-forum .preload-unsubscribe {
|
||||
background: url([[pix:mod_forum|t/unsubscribed]]) no-repeat -9999px -9999px;
|
||||
}
|
||||
|
||||
.path-mod-forum .discussionsubscription {
|
||||
margin-top: -10px;
|
||||
text-align: right;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue