Use effective box title height when unfolding the folder search box

This commit is contained in:
Thomas Bruederli 2014-07-14 09:19:09 +02:00
parent f212dea78c
commit 8845dc032d
4 changed files with 12 additions and 8 deletions

View file

@ -262,14 +262,15 @@ $(document).ready(function(e){
// animation to unfold list search box // animation to unfold list search box
$('#calendars .boxtitle a.search').click(function(e){ $('#calendars .boxtitle a.search').click(function(e){
var box = $('#calendars .listsearchbox'), var title = $('#calendars .boxtitle'),
box = $('#calendars .listsearchbox'),
dir = box.is(':visible') ? -1 : 1; dir = box.is(':visible') ? -1 : 1;
box.slideToggle({ box.slideToggle({
duration: 160, duration: 160,
progress: function(animation, progress) { progress: function(animation, progress) {
if (dir < 0) progress = 1 - progress; if (dir < 0) progress = 1 - progress;
$('#calendars .scroller').css('top', (34 + 34 * progress) + 'px'); $('#calendars .scroller').css('top', (title.outerHeight() + 34 * progress) + 'px');
}, },
complete: function() { complete: function() {
box.toggleClass('expanded'); box.toggleClass('expanded');

View file

@ -107,14 +107,15 @@ if (window.rcmail) {
rcmail.gettext('findaddressbooks', 'kolab_addressbook') + '</a>') rcmail.gettext('findaddressbooks', 'kolab_addressbook') + '</a>')
.appendTo('#directorylistbox h2.boxtitle') .appendTo('#directorylistbox h2.boxtitle')
.click(function(e){ .click(function(e){
var box = $('#directorylistbox .listsearchbox'), var title = $('#directorylistbox .boxtitle'),
box = $('#directorylistbox .listsearchbox'),
dir = box.is(':visible') ? -1 : 1; dir = box.is(':visible') ? -1 : 1;
box.slideToggle({ box.slideToggle({
duration: 160, duration: 160,
progress: function(animation, progress) { progress: function(animation, progress) {
if (dir < 0) progress = 1 - progress; if (dir < 0) progress = 1 - progress;
$('#directorylistbox .scroller').css('top', (34 + 34 * progress) + 'px'); $('#directorylistbox .scroller').css('top', (title.outerHeight() + 34 * progress) + 'px');
}, },
complete: function() { complete: function() {
box.toggleClass('expanded'); box.toggleClass('expanded');

View file

@ -166,14 +166,15 @@ $(document).ready(function(e){
// animation to unfold list search box // animation to unfold list search box
$('#notebooksbox .boxtitle a.search').click(function(e){ $('#notebooksbox .boxtitle a.search').click(function(e){
var box = $('#notebooksbox .listsearchbox'), var title = $('#notebooksbox .boxtitle'),
box = $('#notebooksbox .listsearchbox'),
dir = box.is(':visible') ? -1 : 1; dir = box.is(':visible') ? -1 : 1;
box.slideToggle({ box.slideToggle({
duration: 160, duration: 160,
progress: function(animation, progress) { progress: function(animation, progress) {
if (dir < 0) progress = 1 - progress; if (dir < 0) progress = 1 - progress;
$('#notebooksbox .scroller').css('top', (34 + 34 * progress) + 'px'); $('#notebooksbox .scroller').css('top', (title.outerHeight() + 34 * progress) + 'px');
}, },
complete: function() { complete: function() {
box.toggleClass('expanded'); box.toggleClass('expanded');

View file

@ -201,14 +201,15 @@ $(document).ready(function(e){
// animation to unfold list search box // animation to unfold list search box
$('#tasklistsbox .boxtitle a.search').click(function(e){ $('#tasklistsbox .boxtitle a.search').click(function(e){
var box = $('#tasklistsbox .listsearchbox'), var title = $('#tasklistsbox .boxtitle'),
box = $('#tasklistsbox .listsearchbox'),
dir = box.is(':visible') ? -1 : 1; dir = box.is(':visible') ? -1 : 1;
box.slideToggle({ box.slideToggle({
duration: 160, duration: 160,
progress: function(animation, progress) { progress: function(animation, progress) {
if (dir < 0) progress = 1 - progress; if (dir < 0) progress = 1 - progress;
$('#tasklistsbox .scroller').css('top', (34 + 34 * progress) + 'px'); $('#tasklistsbox .scroller').css('top', (title.outerHeight() + 34 * progress) + 'px');
}, },
complete: function() { complete: function() {
box.toggleClass('expanded'); box.toggleClass('expanded');