Browse Source

Merge pull request #33 from dryabov/master

improve profile popup (hide empty fields, fix scrollbar issue)
master
iHedgehog 11 years ago
parent
commit
f6d5096edb
  1. 30
      css/profile.css
  2. 8
      home.html
  3. 19
      js/interface_common.js
  4. 16
      js/twister_io.js

30
css/profile.css

@ -231,6 +231,9 @@
margin-left: -300px; margin-left: -300px;
} }
.profile-modal .modal-header, .profile-modal .profile-card {
z-index: 1;
}
.profile-modal .modal-content .profile-modal .modal-content
{ {
padding: 3px; padding: 3px;
@ -250,9 +253,10 @@
text-align: center; text-align: center;
} }
#msngrswr { #msngrswr {
position: absolute; display: none;
left: 10px; margin-left: 10px;
margin-top: 10px; margin-top: 10px;
height: 40px;
} }
#toxbtnwr, #bmbtnwr { #toxbtnwr, #bmbtnwr {
float: left; float: left;
@ -315,7 +319,6 @@
{ {
display: inline-block; display: inline-block;
margin-left: -4px; margin-left: -4px;
margin-top: 40px;
border-bottom: 0; border-bottom: 0;
} }
button.follow:hover { button.follow:hover {
@ -349,9 +352,13 @@ button.follow:hover {
} }
.profile-modal .postboard-posts .profile-modal .postboard-posts
{ {
display: block; position: absolute;
height: 90%; top: 0;
height: 100%;
box-sizing: border-box;
border-top: 292px solid transparent;
overflow: auto; overflow: auto;
z-index: 0;
} }
.profile-modal .profile-card-main .profile-modal .profile-card-main
{ {
@ -402,3 +409,16 @@ h2.profile-screen-name {
.profile-modal .modal-buttons { .profile-modal .modal-buttons {
display: none; display: none;
} }
.profile-modal h1.profile-name,
.profile-modal h2.profile-screen-name,
.profile-modal span.profile-location,
.profile-modal a.profile-url {
display: block;
}
.profile-modal span.profile-location:empty,
.profile-modal a.profile-url:empty,
.profile-modal a.profile-bio:empty {
display: none;
}

8
home.html

@ -435,12 +435,8 @@
<div class="profile-card-main"> <div class="profile-card-main">
<img class="profile-card-photo" src="img/grayed_avatar_placeholder_24.png"/> <img class="profile-card-photo" src="img/grayed_avatar_placeholder_24.png"/>
<h1 class="profile-name"></h1> <h1 class="profile-name"></h1>
<div> <h2 class="profile-screen-name">@<b></b></h2>
<h2 class="profile-screen-name">@<b></b></h2> <span class="profile-location"></span>
</div>
<div>
<span class="profile-location"></span>
</div>
<a class="profile-url" rel="nofollow" target="_blank"></a> <a class="profile-url" rel="nofollow" target="_blank"></a>
<div class="profile-bio"></div> <div class="profile-bio"></div>
<div id="msngrswr"> <div id="msngrswr">

19
js/interface_common.js

@ -119,13 +119,18 @@ function openProfileModal(e)
unfollow(username); unfollow(username);
}); });
}; };
//hed//fix .modal-content height in profile modal $mc = $('.modal-content');
if($('.modal-blackout').hasClass('profile-modal')){ // $mch = parseInt($('.modal-content').css('height'));//
$mc = $('.modal-content'); // $pch = parseInt($('.profile-card').css('height'));//
$mch = parseInt($('.modal-content').css('height')); // $mc.css('height', $mch - ($pch + Math.floor($mch/50)));//hed//fix .modal-content height
$pch = parseInt($('.profile-card').css('height'));
$mc.css('height', $mch - ($pch + Math.floor($mch/50))); $mc.off('profileloaded');
} $mc.on('profileloaded', function() {
var viewHeader = $mc.find(".postboard > h2");
var h = viewHeader.offset().top + viewHeader.outerHeight() - $mc.parent().offset().top + 5;
$mc.find(".postboard-posts").css('border-top', parseInt(h, 10) + "px solid transparent");
});
$mc.trigger('profileloaded');
} }
function newHashtagModal(hashtag) { function newHashtagModal(hashtag) {

16
js/twister_io.js

@ -196,6 +196,9 @@ function getProfileResource( username, resource, item, cbFunc, cbArg ){
if( args.cbFunc ) if( args.cbFunc )
args.cbFunc(args.cbArg, null); args.cbFunc(args.cbArg, null);
} }
if (item) {
item.trigger('profileloaded');
}
}, {username:username,item:item,cbFunc:cbFunc,cbArg:cbArg}); }, {username:username,item:item,cbFunc:cbFunc,cbArg:cbArg});
} }
} }
@ -225,11 +228,8 @@ function getTox( username, item ){
item.empty(); item.empty();
if(text) { if(text) {
item.attr('href', 'tox:'+text); item.attr('href', 'tox:'+text);
item.next().attr('data', text);
setTimeout(function(){ item.parent().show().parent().show();
$('#toxbtnwr').show()
$('.tox-ctc').attr('data', text);
}, 0);
} }
}, item); }, item);
} }
@ -240,10 +240,8 @@ function getBitmessage( username, item ){
item.empty(); item.empty();
if(text) { if(text) {
item.attr('href', 'bitmsg:'+text+'?action=add&label='+username); item.attr('href', 'bitmsg:'+text+'?action=add&label='+username);
setTimeout(function(){ item.next().attr('data', text);
$('#bmbtnwr').show(); item.parent().show().parent().show();
$('.bitmessage-ctc').attr('data', text);
}, 0);
} }
}, item); }, item);
} }

Loading…
Cancel
Save