aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js32
1 files changed, 23 insertions, 9 deletions
diff --git a/view/js/main.js b/view/js/main.js
index d86b74345..b9fb9f85e 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -275,7 +275,7 @@ $(function() {
});
/* setup field_richtext */
- setupFieldRichtext();
+ //setupFieldRichtext();
/* Turn elements with one of our special rel tags into popup menus */
@@ -616,12 +616,20 @@ function updateConvItems(mode,data) {
function collapseHeight() {
$(".wall-item-body, .contact-info").each(function() {
- if($(this).height() > divmore_height + 10) {
+ var orgHeight = $(this).height();
+ if(orgHeight > divmore_height + 10) {
if(! $(this).hasClass('divmore')) {
$(this).readmore({
collapsedHeight: divmore_height,
moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>',
- lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>'
+ lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>',
+ beforeToggle: function(trigger, element, expanded) {
+ if(expanded) {
+ if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
+ $('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 100 } );
+ }
+ }
+ }
});
$(this).addClass('divmore');
}
@@ -666,8 +674,10 @@ function liveUpdate() {
else
update_mode = 'append';
}
- else
+ else {
update_mode = 'update';
+ var orgHeight = $("#region_2").height();
+ }
$.get(update_url, function(data) {
page_load = false;
@@ -676,6 +686,10 @@ function liveUpdate() {
$("#page-spinner").spin(false);
$("#profile-jot-text-loading").spin(false);
+ if(update_mode === 'update') {
+ $(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight);
+ }
+
in_progress = false;
// FIXME - the following lines were added so that almost
@@ -1046,9 +1060,9 @@ function fcFileBrowser (field_name, url, type, win) {
return false;
}
-function setupFieldRichtext(){
- return;
/*
+function setupFieldRichtext(){
+
tinyMCE.init({
theme : "advanced",
mode : "specific_textareas",
@@ -1072,9 +1086,9 @@ function setupFieldRichtext(){
theme_advanced_path : false,
file_browser_callback : "fcFileBrowser",
});
-*/
-}
+}
+*/
/**
* sprintf in javascript
@@ -1340,4 +1354,4 @@ function zid(s) {
s = s + achar + 'f=&zid=' + zid;
return s;
-} \ No newline at end of file
+}