From afd6fd8ff52c48b27c150896b493954889346c81 Mon Sep 17 00:00:00 2001 From: llj Date: Fri, 7 Sep 2012 10:44:12 +0800 Subject: [PATCH] [file-op]close other op-list popup when open one --- media/css/seahub.css | 1 + templates/repo.html | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index d937d1d033..eb3e69aeac 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -441,6 +441,7 @@ ul.with-bg li { font-weight:normal; } #simplemodal-container h3 { + word-wrap:break-word; margin:0 0 4px; } .simplemodal-close { diff --git a/templates/repo.html b/templates/repo.html index 4c1d22fb42..a0dfdded2c 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -271,18 +271,20 @@ $("table tr:gt(0)").hover( $('#main-panel').removeClass('ovhd'); var clicked_more_op; $('.more-op').click(function(e) { - clicked_more_op = $(this); + var its_op_list = $(this).next(); if ($(this).attr('data')) { // no popup + clicked_more_op = $(this); $(this).parent().css('position','relative'); - if ($(this).offset().top + $(this).next().height() <= $('#main').offset().top + $('#main').height()) { - $(this).next().css('top', 6); + if ($(this).offset().top + its_op_list.height() <= $('#main').offset().top + $('#main').height()) { + its_op_list.css('top', 6); } else { - $(this).next().css('bottom', 2); + its_op_list.css('bottom', 2); } - $(this).next().removeClass('hide'); + $('.op-list').addClass('hide'); + its_op_list.removeClass('hide'); $(this).attr('data',''); } else { - $(this).next().addClass('hide'); + its_op_list.addClass('hide'); $(this).attr('data','no-popup'); } });