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

1
js/interface_common.js

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

33
js/twister_following.js

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

Loading…
Cancel
Save