Browse Source

make link to more followers in profile to be openning followers modal

readme-update
Simon Grim 9 years ago
parent
commit
44e190bc4a
  1. 4
      home.html
  2. 1
      js/interface_common.js
  3. 33
      js/twister_following.js

4
home.html

@ -664,6 +664,10 @@
</div> </div>
<!-- MODAL DE PROFILE END --> <!-- MODAL DE PROFILE END -->
<div id="template-profile-show-more-followers">
<a class="show-more-followers"></a>
</div>
<!-- MODAL DE HASHTAGS --> <!-- MODAL DE HASHTAGS -->
<div id="hashtag-modal-template"> <div id="hashtag-modal-template">
<!-- ÁREA DE POSTS INIT --> <!-- ÁREA DE POSTS INIT -->

1
js/interface_common.js

@ -2289,6 +2289,7 @@ $(document).ready(function () {
.on('click', muteEvent) // to prevent post expanding or collapsing .on('click', muteEvent) // to prevent post expanding or collapsing
; ;
twister.tmpl.postRtBy = extractTemplate('#template-post-rt-by'); twister.tmpl.postRtBy = extractTemplate('#template-post-rt-by');
twister.tmpl.profileShowMoreFollowers = extractTemplate('#template-profile-show-more-followers');
var path = window.location.pathname; var path = window.location.pathname;
var page = path.split("/").pop(); var page = path.split("/").pop();

33
js/twister_following.js

@ -483,33 +483,20 @@ function fillWhoFollows(list, item, offset, size) {
} }
} }
function getWhoFollows(username, item) { function getWhoFollows(peerAlias, elem) {
if (!defaultScreenName || typeof(defaultScreenName) === 'undefined') if (!defaultScreenName)
return; return;
var list = whoFollows(username); var list = whoFollows(peerAlias);
fillWhoFollows(list, item, 0, (list.length > 5 ? 5 : list.length)); fillWhoFollows(list, elem, 0, (list.length > 5 ? 5 : list.length));
if (list.length > 5) { if (list.length > 5)
var more_link = $('<a class="show-more-followers">' + polyglot.t('show_more_count', {'smart_count': list.length - 5}) + '</a>'); twister.tmpl.profileShowMoreFollowers.clone(true)
more_link.on('click', function() { .text(polyglot.t('show_more_count', {'smart_count': list.length - 5}))
fillWhoFollows(list, item, 5, list.length - 5); .on('mouseup', {route: '#followers?user=' + peerAlias}, routeOnClick)
.appendTo(elem)
var $this = $(this); ;
$this.remove();
$this.text(polyglot.t('hide'));
$this.unbind('click');
$this.bind('click', function() {
item.html('');
getWhoFollows(username, item);
});
item.append($this);
});
item.append(more_link);
}
} }
function processWhoToFollowSuggestion(suggestion, followedBy) { function processWhoToFollowSuggestion(suggestion, followedBy) {

Loading…
Cancel
Save