Explorar el Código

fixing hashtag parsing

logicp hace 7 años
padre
commit
c4ec9a4288
Se han modificado 3 ficheros con 9 adiciones y 2 borrados
  1. 4 0
      js/statusmessage.js
  2. 3 1
      src/StatusHeartPost.php
  3. 2 1
      src/StatusYoutube.php

+ 4 - 0
js/statusmessage.js

@@ -5,6 +5,10 @@
   Drupal.behaviors.status= {
     attach: function (context, settings) {
 
+      if (Drupal.AjaxCommands){
+        Drupal.AjaxCommands.prototype.viewsScrollTop = null;
+      }
+
       Drupal.AjaxCommands.prototype.generatePreview = function(ajax, response, status) {
 
         if (validateUrl(response.url)) {

+ 3 - 1
src/StatusHeartPost.php

@@ -140,10 +140,12 @@ class StatusHeartPost implements SharedContentInterface {
     $tids = array();
     $i = 0;
     $tagsArray = explode('#', $message);
-    $num = count($tagsArray);
 
     unset($tagsArray[0]);
 
+    $num = count($tagsArray);
+
+
     foreach ($tagsArray as $hashtag) {
       if ($i === $num - 1) {
         $lastTagArray = explode(' ', $hashtag);

+ 2 - 1
src/StatusYoutube.php

@@ -103,10 +103,11 @@ class StatusYoutube {
     $tids = array();
     $i = 0;
     $tagsArray = explode('#', $message);
-    $num = count($tagsArray);
 
     unset($tagsArray[0]);
 
+    $num = count($tagsArray);
+
     foreach ($tagsArray as $hashtag) {
       if ($i === $num - 1) {
         $lastTagArray = explode(' ', $hashtag);