1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-01 23:38:37 +00:00

Merge pull request #620 from haiwen/add_org_lib

[org view] modified 'add library'
This commit is contained in:
xiez 2015-05-28 17:43:19 +08:00
commit d2a075df68
4 changed files with 46 additions and 13 deletions

View File

@ -1187,6 +1187,9 @@ textarea:-moz-placeholder {/* for FF */
padding-bottom:0;
height:39px;
}
#organization-repos .hd {
position:relative;
}
.repo-file-list-topbar {
margin-bottom:0;
}
@ -1234,6 +1237,9 @@ textarea:-moz-placeholder {/* for FF */
background:#fff;
line-height:17px;
}
#add-pub-lib {
outline:none;
}
/* info-bar */
#info-bar {
color: #1f0600;
@ -2007,7 +2013,8 @@ textarea:-moz-placeholder {/* for FF */
position:relative;
overflow:hidden;
}
#upload-menu {
#upload-menu,
#add-pub-lib-menu {
position:absolute;
z-index:12; /* make it on top of a checkbox */
border:1px solid #c5c5c5;
@ -2015,12 +2022,16 @@ textarea:-moz-placeholder {/* for FF */
box-shadow: 0 0 2px #c5c5c5;
background:#fff;
}
#upload-menu .item {
position:relative;
text-align:left;
#upload-menu .item,
#add-pub-lib-menu .item {
padding:0 10px;
height:27px;
line-height:27px;
cursor:pointer;
}
#upload-menu .item {
position:relative;
text-align:left;
overflow:hidden; /* for 'hover', as long 'input' in it. */
}
.fixed-upload-file-dialog {
@ -3573,9 +3584,6 @@ textarea:-moz-placeholder {/* for FF */
overflow-y: auto;
overflow-x: hidden;
}
button.add-pub-repo {
margin-right:10px;
}
/* share popup */
#download-link-operations dl {

View File

@ -733,7 +733,7 @@
</tr>
</script>
<script type="text/template" id="add-pubrepo-popup-tmpl">
<h3 class="hd">{% trans "Add organizaiton library" %}</h3>
<h3 class="hd">{% trans "Select libraries to share" %}</h3>
<img class="loading-tip" width="32" src="{{MEDIA_URL}}img/loading-new.gif" alt="{% trans 'Loading...' %}" />
<table class="hide">
<thead>

View File

@ -182,10 +182,13 @@
</div>
<div id="organization-repos" class="tab-tabs hide">
<div class="hd ovhd">
<div class="hd">
<h3 class="fleft">{% trans "Libraries" %}</h3>
<button class="repo-create fright"><img src="{{ MEDIA_URL }}img/add.png" alt="" class="add vam" /><span class="vam">{% trans "New Library"%}</span></button>
<button class="add-pub-repo fright"><img src="{{ MEDIA_URL }}img/add.png" alt="" class="add vam" /><span class="vam">{% trans "Add Library"%}</span></button>
<button id="add-pub-lib" class="fright"><img src="{{ MEDIA_URL }}img/add.png" alt="" class="add vam" /><span class="vam">{% trans "Add Library"%}</span></button>
<ul id="add-pub-lib-menu" class="hide">
<li class="item share-existing">{% trans "Share existing" %}</li>
<li class="item create-new">{% trans "Create new" %}</li>
</ul>
</div>
<table class="repo-list hide">

View File

@ -31,11 +31,33 @@ define([
this.listenTo(this.repos, 'reset', this.reset);
this.dirView = options.dirView;
// show/hide 'add lib' menu
var $add_lib = $('#add-pub-lib'),
$add_lib_menu = $('#add-pub-lib-menu');
$add_lib.click(function() {
$add_lib_menu.toggleClass('hide');
$add_lib_menu.css({
'top': $add_lib.position().top + $add_lib.outerHeight(),
'right': 10 // align right with $add_lib
});
});
$('.item', $add_lib_menu).hover(
function() {
$(this).css({'background':'#f3f3f3'});
},
function() {
$(this).css({'background':'transparent'});
}
);
$(document).click(function(e) {
Common.closePopup(e, $add_lib_menu, $add_lib);
});
},
events: {
'click #organization-repos .repo-create': 'createRepo',
'click #organization-repos .add-pub-repo': 'addRepo',
'click #organization-repos .share-existing': 'addRepo',
'click #organization-repos .create-new': 'createRepo',
'click #organization-repos .by-name': 'sortByName',
'click #organization-repos .by-time': 'sortByTime'
},