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

1
js/twister_actions.js

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

Loading…
Cancel
Save