mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
[dir view] fileupload: added support for IE9
This commit is contained in:
@@ -4344,6 +4344,18 @@ img.thumbnail {
|
||||
max-width:215px;
|
||||
}
|
||||
/* dir view */
|
||||
#basic-upload { /* for IE 9 */
|
||||
position: relative;
|
||||
}
|
||||
.basic-upload-input { /* for IE 9 */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
#dir-view-path {
|
||||
display:flex;
|
||||
justify-content:space-between;
|
||||
|
@@ -445,7 +445,10 @@
|
||||
<div id="basic-upload" class="inline-block">
|
||||
<button class="basic-upload-btn btn-white hidden-sm-down">{% trans "Upload" %}</button>
|
||||
<span class="basic-upload-btn sf2-icon-upload mobile-icon hidden-md-up" aria-label="{% trans "Upload" %}"></span>
|
||||
<input id="basic-upload-input" class="hide" type="file" name="file" multiple />
|
||||
<!--[if lt IE 10]>
|
||||
<input class="basic-upload-input" type="file" name="file" multiple />
|
||||
<![endif]-->
|
||||
<input class="basic-upload-input hide" type="file" name="file" multiple />
|
||||
</div>
|
||||
<% if (app.pageOptions.enable_upload_folder) { %>
|
||||
<div id="advanced-upload" class="sf-dropdown sf-dropdown-inline">
|
||||
|
@@ -309,7 +309,7 @@ define([
|
||||
var $popup = this.fileUploadView.$el;
|
||||
|
||||
if (app.pageOptions.enable_upload_folder) {
|
||||
if ('webkitdirectory' in $('#basic-upload-input')[0]) {
|
||||
if ('webkitdirectory' in $('.basic-upload-input')[0]) {
|
||||
this.$("#basic-upload").remove();
|
||||
this.$("#advanced-upload").show();
|
||||
this.upload_dropdown = new DropdownView({
|
||||
@@ -326,13 +326,13 @@ define([
|
||||
$popup.fileupload(
|
||||
'option',
|
||||
'fileInput',
|
||||
this.$('#basic-upload-input'));
|
||||
this.$('.basic-upload-input:eq(0)'));
|
||||
}
|
||||
} else {
|
||||
$popup.fileupload(
|
||||
'option',
|
||||
'fileInput',
|
||||
this.$('#basic-upload-input'));
|
||||
this.$('.basic-upload-input:eq(0)'));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -629,7 +629,7 @@ define([
|
||||
},
|
||||
|
||||
uploadFile: function() {
|
||||
this.$('#basic-upload-input').trigger('click');
|
||||
this.$('.basic-upload-input').trigger('click');
|
||||
},
|
||||
|
||||
advancedUploadFile: function() {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
define([
|
||||
'common',
|
||||
'backbone',
|
||||
'jquery.iframe-transport', // for IE 9
|
||||
'jquery.fileupload-ui'
|
||||
], function(Common, Backbone, FileUpload) {
|
||||
|
||||
@@ -342,7 +343,8 @@ define([
|
||||
}
|
||||
var path = dirents.path;
|
||||
path = path == '/' ? path : path + '/';
|
||||
if (data.formData.parent_dir != path) {
|
||||
var parent_dir = popup.fileupload('option','formData').parent_dir;
|
||||
if (parent_dir != path) {
|
||||
return;
|
||||
}
|
||||
if (!file_path) {
|
||||
@@ -479,7 +481,7 @@ define([
|
||||
popup.fileupload(
|
||||
'option',
|
||||
'redirect',
|
||||
window.location.href.replace(/\/repo\/[-a-z0-9]{36}\/.*/, app.config.mediaUrl + 'cors/result.html?%s')
|
||||
location.protocol + '//' + location.host + app.config.mediaUrl + 'cors/result.html?%s'
|
||||
);
|
||||
|
||||
},
|
||||
|
Reference in New Issue
Block a user