Browse Source

rename followingList related stuff, delete MAL.followingListLoaded()

readme-update
Simon Grim 9 years ago
parent
commit
9baa250ef0
  1. 2
      home.html
  2. 20
      js/interface_common.js
  3. 8
      js/mobile_abstract.js
  4. 2
      js/tmobile.js
  5. 2
      tmobile.html

2
home.html

@ -708,7 +708,7 @@ @@ -708,7 +708,7 @@
</ol>
</div>
<div id="template-following-user">
<div id="template-following-peer">
<li>
<div class="mini-profile-info">
<a href="#" class="open-profile-modal">

20
js/interface_common.js

@ -600,7 +600,7 @@ function openFollowingModal(peerAlias) { @@ -600,7 +600,7 @@ function openFollowingModal(peerAlias) {
content: twister.tmpl.followingList.clone(true),
title: polyglot.t('Following')
});
showFollowingUsers(modal.content.find('.following-list'));
appendFollowingToElem(modal.content.find('.following-list'));
requestSwarmProgress();
} else {
var modal = openModal({
@ -613,18 +613,18 @@ function openFollowingModal(peerAlias) { @@ -613,18 +613,18 @@ function openFollowingModal(peerAlias) {
}
}
function showFollowingUsers(followingList) {
function appendFollowingToElem(list) {
if (followingEmptyOrMyself())
$.MAL.warnFollowingNotAny(closeModal, followingList);
$.MAL.warnFollowingNotAny(closeModal, list);
else
for (var i = 0; i < followingUsers.length; i++)
addToFollowingList(followingList, followingUsers[i]);
addPeerToFollowingList(list, followingUsers[i]);
$.MAL.followingListLoaded(followingList);
$.MAL.listLoaded(list);
}
function addToFollowingList(followingList, peerAlias) {
var item = twister.tmpl.followingUser.clone(true).attr('data-peer-alias', peerAlias);
function addPeerToFollowingList(list, peerAlias) {
var item = twister.tmpl.followingPeer.clone(true).attr('data-peer-alias', peerAlias);
item.find('.mini-profile-info').attr('data-screen-name', peerAlias)
item.find('.following-screen-name').text(peerAlias);
@ -650,7 +650,7 @@ function addToFollowingList(followingList, peerAlias) { @@ -650,7 +650,7 @@ function addToFollowingList(followingList, peerAlias) {
else
elem.text(polyglot.t('Private')).addClass('private');
item.prependTo(followingList);
item.prependTo(list);
}
function fillWhoToFollowModal(list, hlist, start) {
@ -1118,7 +1118,7 @@ function setFollowingMethod(event) { @@ -1118,7 +1118,7 @@ function setFollowingMethod(event) {
toggleFollowButton({peerAlias: req.peerAlias, toggleUnfollow: req.toggleUnfollow});
var followingList = getElem('.following-own-modal .following-list');
if (followingList.length)
addToFollowingList(followingList, req.peerAlias);
addPeerToFollowingList(followingList, req.peerAlias);
}, {peerAlias: peerAlias, toggleUnfollow: true}
);
}
@ -2257,7 +2257,7 @@ $(document).ready(function () { @@ -2257,7 +2257,7 @@ $(document).ready(function () {
twister.tmpl.followersList = extractTemplate('#template-followers-list');
twister.tmpl.followersPeer = extractTemplate('#template-followers-peer');
twister.tmpl.followingList = extractTemplate('#template-following-list');
twister.tmpl.followingUser = extractTemplate('#template-following-user');
twister.tmpl.followingPeer = extractTemplate('#template-following-peer');
twister.tmpl.commonDMsListItem = extractTemplate('#template-direct-messages-list-item')
.on('mouseup', function (event) {
event.data = {route:

8
js/mobile_abstract.js

@ -81,14 +81,6 @@ var MAL = function() @@ -81,14 +81,6 @@ var MAL = function()
list.find('.loading-roller').hide();
};
this.followingListLoaded = function(followingList) {
if ($.hasOwnProperty('mobile')) {
$.mobile.hidePageLoadingMsg();
followingList.listview('refresh');
} else
followingList.find('.loading-roller').hide();
};
this.searchUserListLoaded = function() {
if( $.hasOwnProperty("mobile") ) {
$.mobile.hidePageLoadingMsg();

2
js/tmobile.js

@ -163,7 +163,7 @@ var router=new $.mobile.Router( @@ -163,7 +163,7 @@ var router=new $.mobile.Router(
$("#following a.ui-btn").removeClass("ui-btn-active");
var followingList = twister.tmpl.followingList.clone(true).appendTo($("#following .content"))
.closest('.following-list').listview();
showFollowingUsers(followingList);
appendFollowingToElem(followingList);
followingList.find('[data-role="button"]').button();
});
},

2
tmobile.html

@ -848,7 +848,7 @@ @@ -848,7 +848,7 @@
<ul class="following-list" data-role="listview"></ul>
</div>
<div id="template-following-user">
<div id="template-following-peer">
<li>
<div class="mini-profile-info">
<a href="#" class="open-profile-modal">

Loading…
Cancel
Save