Browse Source

Merge pull request #311 from slr/tasty-group-messages

#letsfixeverythin
master
miguelfreitas 9 years ago
parent
commit
d84e056720
  1. 4
      css/profile.css
  2. 25
      js/interface_common.js
  3. 10
      js/jQueryPlugins.js
  4. 4
      theme_calm/css/profile.css
  5. 4
      theme_nin/css/style.css
  6. 3
      theme_nin/sass/_profile.sass

4
css/profile.css

@ -281,6 +281,10 @@ @@ -281,6 +281,10 @@
}
*/
.profile-modal .members {
overflow-y: auto;
}
h1.profile-name {
display: inline;
}

25
js/interface_common.js

@ -171,11 +171,13 @@ function openGroupProfileModalWithNameHandler(groupAlias) { @@ -171,11 +171,13 @@ function openGroupProfileModalWithNameHandler(groupAlias) {
getFullname(ret.members[i], item.find('.twister-user-full'));
getBio(ret.members[i], item.find('.bio'));
}
elemFitNextIntoParentHeight(req.modal.content.find('.profile-card'));
}
}, {modal: modal}
);
elemFitNextIntoParentHeight(modal.content.find('.profile-card'));
}
function openUserProfileModalWithNameHandler(username) {
@ -201,13 +203,11 @@ function openUserProfileModalWithNameHandler(username) { @@ -201,13 +203,11 @@ function openUserProfileModalWithNameHandler(username) {
button.on('click', userClickFollow);
}
elemFitNextIntoParentHeight(modal.content.find('.profile-card'));
var postboard = modal.content.find('.postboard');
var postboardHeight = modal.content.outerHeight() - modal.content.find('.profile-card').outerHeight();
if (postboardHeight > 0) { // FIXME actually it's here to exclude nin theme
postboard.outerHeight(postboardHeight)
.find('ol').outerHeight(postboard.outerHeight() - postboard.find('h2').outerHeight() - 20); // FIXME 20px for margin, need to fix CSS for it
} else
postboard.outerHeight(modal.content.outerHeight());
postboard.find('ol').outerHeight(postboard.actual('height')
- postboard.find('h2').actual('outerHeight', {includeMargin: true}));
}
function openHashtagModalFromSearchHandler(hashtag) {
@ -1590,6 +1590,17 @@ function killInterfaceModule(module) { @@ -1590,6 +1590,17 @@ function killInterfaceModule(module) {
$('.module.'+module).empty().hide();
}
function elemFitNextIntoParentHeight(elem) {
var parent = elem.parent();
var elemNext = elem.nextAll();
var elemNextHeight = parent.actual('height') - elem.actual('outerHeight', {includeMargin: true});
if (elemNextHeight > 0) // FIXME actually it's here because of nin theme's two vertical columns layout of profile modal
elemNext.outerHeight(elemNextHeight);
else
elemNext.outerHeight(parent.actual('outerHeight'));
}
function inputEnterActivator(event) {
var elemEvent = $(event.target);
elemEvent.parents(event.data.parentSelector).find(event.data.enterSelector)

10
js/jQueryPlugins.js

@ -17,6 +17,16 @@ window.setInterval = function (vCallback, nDelay) { // additional arguments wil @@ -17,6 +17,16 @@ window.setInterval = function (vCallback, nDelay) { // additional arguments wil
function () {vCallback.apply(oThis, aArgs);} : vCallback, nDelay);
};
// get actual width/height of elements including invisible ones
// minified 1.0.17 of https://github.com/dreamerslab/jquery.actual
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a);
}else{a(jQuery);}}(function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf;a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual => The jQuery method "'+b+'" you called does not exist';
}var f={absolute:false,clone:false,includeMargin:false,display:"block"};var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; ";
e=e.clone().attr("style",m).appendTo("body");};j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden");
d+="visibility: hidden !important; display: "+i.display+" !important; ";if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this);
var n=m.attr("style");g.push(n);m.attr("style",n?n+";"+d:d);});};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style");
}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b]();j();return k;}});}));
// bind callback function for event of clicking outside of element
(function(jQuery) {
jQuery.fn.clickoutside = function(callback) {

4
theme_calm/css/profile.css

@ -356,6 +356,10 @@ @@ -356,6 +356,10 @@
}
*/
.profile-modal .members {
overflow-y: auto;
}
h1.profile-name {
display: inline;
}

4
theme_nin/css/style.css

@ -461,6 +461,10 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, @@ -461,6 +461,10 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu,
padding: 0;
}
.profile-modal .modal-content .members {
overflow-y: auto;
}
/* line 76, ../sass/_profile.sass */
.profile-modal h2.profile-screen-name {
display: block;

3
theme_nin/sass/_profile.sass

@ -67,6 +67,9 @@ $modal-postboard-post-height: 100% @@ -67,6 +67,9 @@ $modal-postboard-post-height: 100%
margin: 0
padding: 0
.members
overflow-y: auto
.profile-modal
h2.profile-screen-name
display: block

Loading…
Cancel
Save