1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

[repo] improved 'file share' popup

This commit is contained in:
llj
2013-07-01 14:29:22 +08:00
parent 96dbf73161
commit 8c598ddc7c
3 changed files with 42 additions and 40 deletions

View File

@@ -1965,7 +1965,8 @@ textarea:-moz-placeholder {/* for FF */
border:0;
}
#shared-link-text {
vertical-align:middle; /*for ie 7*/
/*vertical-align:middle; for ie 7*/
background:transparent;
}
.file-op {
margin-top:0.8em;

View File

@@ -326,8 +326,8 @@
<button class="simplemodal-close">{% trans "Cancel"%}</button>
</form>
<div id="file-share" class="hide">
<h3>{% trans 'Share' %} <span class="op-target"></span></h3>
<div id="file-share" class="tab-popup hide">
<h3 class="hd">{% trans 'Share' %} <span class="op-target"></span></h3>
<div id="repo-share-tabs">
<ul id="repo-share-tabs-nav">
@@ -350,8 +350,9 @@
<input type="submit" value="{% trans "Submit"%}" />
</form>
</div> <!--/#private-share-->
<div id="shared-link">
<p>{% trans 'Link: ' %}<input type="text" readonly="readonly" id="shared-link-text" /></p>
<p><span class="vam">{% trans 'Link: ' %}</span><input type="text" readonly="readonly" id="shared-link-text" class="vam" /></p>
<button id="send-link">{% trans 'Send' %}</button>
<form id="link-send-form" action="" method="post" class="hide">{% csrf_token %}
<label>{% trans "Send to:"%}</label><br />
@@ -695,11 +696,11 @@ $('.file-share').click(function() {
$('#file-share .op-target').html(trimFilename(filename, 30));
$('#shared-link-text, #link-send-form input[name="file_shared_link"]').val(link);
$('#main').append('<p id="linkwidth" class="hide">' + link + '</p>');
$('#shared-link-text').css({'width':$('#linkwidth').width() + 20});
$('#file-share').modal({'focus':false}); // in ff: if 'focus' is true, 'shared-link-text' gets the focus
$('#shared-link-text').css({'width':$('#linkwidth').width() + 25});
$('#file-share').modal({appendTo: "#main",'focus':false, containerCss:{"padding": "10px 0 0"}}); // in ff: if 'focus' is true, 'shared-link-text' gets the focus
$("#repo-share-tabs").tabs();
$('#linkwidth').remove();
$('#simplemodal-container').css({'height':'auto', 'width': '400px'});
$('#simplemodal-container').css({'height':'auto'});
}
if ($(this).data('link')) {
showPopup($(this).data('link'));
@@ -927,12 +928,12 @@ function renderDirTree(container, repo_data) {
item = {
'data': o.name,
'attr': { 'repo_id': o.repo_id, 'type': o.type },
'state': 'closed',
'state': 'closed'
};
} else {
item = {
'data': o.name,
'attr': {'type': o.type },
'attr': {'type': o.type }
};
}
items.push(item);

View File

@@ -72,7 +72,7 @@ $('#send-shared-link').click(function() { // for file_view.html and subdir page
$('#send-link').click(function() { // for 'file-share' in repo.html
$(this).addClass('hide');
var input = $('#link-send-input');
input.css({'width': $('#file-share').width() - parseInt(input.css('padding-left')) - parseInt(input.css('padding-right')) - parseInt(input.css('border-left-width')) - parseInt(input.css('border-right-width'))});
input.css({'width': $('#shared-link').width() - parseInt(input.css('padding-left')) - parseInt(input.css('padding-right')) - parseInt(input.css('border-left-width')) - parseInt(input.css('border-right-width'))});
$('#link-send-form').removeClass('hide');
addAutocomplete('#link-send-input', '#link-send-form', share_list);
});