Browse Source

fix "There aren't any posts with this hashtag" bug

master
Miguel Freitas 10 years ago
parent
commit
8099b91d1a
  1. 20
      js/interface_common.js
  2. 1
      js/twister_actions.js

20
js/interface_common.js

@ -112,15 +112,18 @@ function openProfileModal(e) @@ -112,15 +112,18 @@ function openProfileModal(e)
openProfileModalWithUsername(username);
}
function openProfileModalWithUsername(username)
{
if(!username)
{
alert(polyglot.t("You don't have any profile because you are not logged in."));
return;
alert(polyglot.t("You don't have any profile because you are not logged in."));
return;
}
window.location.hash = '#profile?user=' + username;
}
function openProfileModalWithUsernameHandler(username)
{
var profileModalClass = "profile-modal";
openModal( profileModalClass );
@ -139,7 +142,6 @@ function openProfileModalWithUsername(username) @@ -139,7 +142,6 @@ function openProfileModalWithUsername(username)
$(".tox-ctc").attr("title", polyglot.t("Copy to clipboard"));
$(".bitmessage-ctc").attr("title", polyglot.t("Copy to clipboard"));
window.location.hash = '#profile?user=' + username;
}
function newHashtagModal(hashtag) {
@ -166,6 +168,11 @@ function openHashtagModal(e) @@ -166,6 +168,11 @@ function openHashtagModal(e)
}
function openHashtagModalFromSearch(hashtag)
{
window.location.hash = '#hashtag?hashtag=' + hashtag;
}
function openHashtagModalFromSearchHandler(hashtag)
{
var hashtagModalClass = "hashtag-modal";
openModal( hashtagModalClass );
@ -176,7 +183,6 @@ function openHashtagModalFromSearch(hashtag) @@ -176,7 +183,6 @@ function openHashtagModalFromSearch(hashtag)
//título do modal
$( "."+hashtagModalClass + " h3" ).text( "#" + hashtag );
window.location.hash = '#hashtag?hashtag=' + hashtag;
}
function updateHashtagModal(postboard,hashtag) {
@ -372,9 +378,9 @@ function watchHashChange(e) @@ -372,9 +378,9 @@ function watchHashChange(e)
if (hashdata && hashdata[1] != undefined && hashdata[2] != undefined)
{
if(hashdata[1] == 'profile') {
openProfileModalWithUsername(hashdata[2]);
openProfileModalWithUsernameHandler(hashdata[2]);
}else if (hashdata[1] == 'hashtag') {
openHashtagModalFromSearch(hashdata[2]);
openHashtagModalFromSearchHandler(hashdata[2]);
}
} else {
closeModalHandler();

1
js/twister_actions.js

@ -304,7 +304,6 @@ function requestHashtag(postboard,hashtag,resource) { @@ -304,7 +304,6 @@ function requestHashtag(postboard,hashtag,resource) {
processHashtag(args.postboard, args.hashtag, data);
}, {postboard:postboard,hashtag:hashtag},
[10000,2000,3]); // use extended timeout parameters (requires twister_core >= 0.9.14)
}
function processHashtag(postboard, hashtag, data) {

Loading…
Cancel
Save