Browse Source

Don't bail too early.

Apply timeago on timestamps present on page load even if Realtime isn't
enabled.
Chimo 2 years ago
parent
commit
bc71313158
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      js/gs-timeago.js

+ 5
- 5
js/gs-timeago.js View File

@@ -2,16 +2,16 @@
2 2
     /*global RealtimeUpdate: false*/
3 3
     "use strict";
4 4
 
5
-    // Bail if 'RealtimeUpdate' isn't available
6
-    if ( typeof( RealtimeUpdate ) === "undefined" ) {
7
-        return;
8
-    }
9
-
10 5
     // Take care of timestamps present on page load
11 6
     $( ".notice .dt-published" )
12 7
         .addClass( "timeago" )
13 8
         .timeago();
14 9
 
10
+    // Bail if 'RealtimeUpdate' isn't available
11
+    if ( typeof( RealtimeUpdate ) === "undefined" ) {
12
+        return;
13
+    }
14
+
15 15
     // Take care of timestamps inserted by Realtime
16 16
     // via a little monkey-patching
17 17
     var orig = RealtimeUpdate.makeNoticeItem;