Browse Source

router also following modal navigation through watchHashChange

master
Julian Steinwachs 10 years ago
parent
commit
fd26787549
  1. 16
      js/interface_common.js

16
js/interface_common.js

@ -253,13 +253,13 @@ function newFollowingModal(username) {
return followingModalContent; return followingModalContent;
} }
function openFollowingModal(e) function openFollowingModal(username)
{ {
e.stopPropagation(); //e.stopPropagation();
e.preventDefault(); //e.preventDefault();
var $this = $( this ); //var $this = $( this );
var username = $.MAL.followingUrlToUser( $this.attr("href") ); //var username = $.MAL.followingUrlToUser( $this.attr("href") );
var followingModalClass = "following-modal"; var followingModalClass = "following-modal";
openModal( followingModalClass ); openModal( followingModalClass );
@ -406,7 +406,7 @@ function watchHashChange(e)
var hashdata = hashstring.split(':'); var hashdata = hashstring.split(':');
if (hashdata[0] != '#web+twister') { if (hashdata[0] != '#web+twister') {
hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages)\?(?:user|hashtag)=(.+)/); hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages|following)\?(?:user|hashtag)=(.+)/);
} }
//console.log(hashdata); //console.log(hashdata);
@ -419,6 +419,8 @@ function watchHashChange(e)
openMentionsModalHandler(hashdata[2]); openMentionsModalHandler(hashdata[2]);
}else if (hashdata[1] == 'directmessages') { }else if (hashdata[1] == 'directmessages') {
openDmWithUserModal(hashdata[2]); openDmWithUserModal(hashdata[2]);
}else if (hashdata[1] == 'following') {
openFollowingModal(hashdata[2]);
} }
} else if (hashstring == '#directmessages') { } else if (hashstring == '#directmessages') {
directMessagesPopup(); directMessagesPopup();
@ -1424,7 +1426,7 @@ function initInterfaceCommon() {
$( ".open-profile-modal").bind( "click", openProfileModal ); $( ".open-profile-modal").bind( "click", openProfileModal );
$( ".open-hashtag-modal").bind( "click", openHashtagModal ); $( ".open-hashtag-modal").bind( "click", openHashtagModal );
$( ".open-following-modal").bind( "click", openFollowingModal ); //$( ".open-following-modal").bind( "click", openFollowingModal );
$( ".userMenu-connections a").bind( "click", openMentionsModal ); $( ".userMenu-connections a").bind( "click", openMentionsModal );
$( ".mentions-from-user").bind( "click", openMentionsModal ); $( ".mentions-from-user").bind( "click", openMentionsModal );

Loading…
Cancel
Save