Merge branch 'MDL-48044-master' of git://github.com/andrewnicols/moodle
authorSam Hemelryk <sam@moodle.com>
Wed, 5 Nov 2014 22:55:46 +0000 (11:55 +1300)
committerSam Hemelryk <sam@moodle.com>
Wed, 5 Nov 2014 22:55:46 +0000 (11:55 +1300)
mod/forum/discuss.php
mod/forum/lib.php
mod/forum/styles.css

index 000f445..f28e0fa 100644 (file)
                 forum_get_discussion_subscription_icon($forum, $post->discussion, null, true),
                 'discussionsubscription'
             );
+            echo forum_get_discussion_subscription_icon_preloaders();
         }
     }
 
index 5f04287..2265ebe 100644 (file)
@@ -3851,6 +3851,19 @@ function forum_get_discussion_subscription_icon($forum, $discussionid, $returnur
     }
 }
 
+/**
+ * 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('&nbsp;', 'preload-subscribe');
+    $o .= html_writer::span('&nbsp;', 'preload-unsubscribe');
+    return $o;
+}
+
 /**
  * Print the drop down that allows the user to select how they want to have
  * the discussion displayed.
@@ -5414,7 +5427,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">&nbsp;</th>';
+                echo '<th class="header discussionsubscription" scope="col">';
+                echo forum_get_discussion_subscription_icon_preloaders();
+                echo '</th>';
             }
         }
         echo '</tr>';
index 23e5129..a5914d7 100644 (file)
@@ -143,6 +143,14 @@ span.unread {
     float: left;
 }
 
+.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;