2018-05-20 12:31:46 +00:00
|
|
|
/**
|
|
|
|
* Conversation page utilities
|
|
|
|
*
|
|
|
|
* @author Pierre HUBERT
|
|
|
|
*/
|
|
|
|
|
|
|
|
ComunicWeb.pages.conversations.utils = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable slimscroll for the conversation element
|
|
|
|
*
|
|
|
|
* @param {HMTLElement} target The target for slimscroll
|
2020-04-13 09:18:04 +00:00
|
|
|
* @param {Number|String} height The available height for the element
|
2018-05-20 12:31:46 +00:00
|
|
|
* @param {Number} pos Scroll position to go to
|
|
|
|
*/
|
|
|
|
enableSlimScroll: function(target, height, pos){
|
|
|
|
|
|
|
|
$(target).slimScroll({
|
|
|
|
scrollTo: pos + "px",
|
2020-04-13 09:18:04 +00:00
|
|
|
height: height + (typeof height == "number" ? "px" : ""),
|
2018-05-20 12:31:46 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the available height for the conversations
|
|
|
|
*
|
|
|
|
* @return {Number} The available height, in pixel
|
|
|
|
*/
|
|
|
|
getAvailableHeight: function(){
|
|
|
|
return Number(byId("pageTarget").style.minHeight.replace("px", "")) - 180;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|