MDL-33175 - filemanager: make dndupload icon clickable
This commit is contained in:
+18
-10
@@ -262,16 +262,12 @@ M.form_filemanager.init = function(Y, options) {
|
||||
var button_addfile = this.filemanager.one('.fp-btn-add');
|
||||
|
||||
// setup 'add file' button
|
||||
// if maxfiles == -1, the no limit
|
||||
button_addfile.on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var options = this.filepicker_options;
|
||||
options.formcallback = this.filepicker_callback;
|
||||
// XXX: magic here, to let filepicker use filemanager scope
|
||||
options.magicscope = this;
|
||||
options.savepath = this.currentpath;
|
||||
M.core_filepicker.show(Y, options);
|
||||
}, this);
|
||||
button_addfile.on('click', this.show_filepicker, this);
|
||||
|
||||
var dndarrow = this.filemanager.one('.dndupload-arrow');
|
||||
if (dndarrow) {
|
||||
dndarrow.on('click', this.show_filepicker, this);
|
||||
}
|
||||
|
||||
// setup 'make a folder' button
|
||||
if (this.options.subdirs) {
|
||||
@@ -369,6 +365,18 @@ M.form_filemanager.init = function(Y, options) {
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
show_filepicker: function (e) {
|
||||
// if maxfiles == -1, the no limit
|
||||
e.preventDefault();
|
||||
var options = this.filepicker_options;
|
||||
options.formcallback = this.filepicker_callback;
|
||||
// XXX: magic here, to let filepicker use filemanager scope
|
||||
options.magicscope = this;
|
||||
options.savepath = this.currentpath;
|
||||
M.core_filepicker.show(Y, options);
|
||||
},
|
||||
|
||||
print_path: function() {
|
||||
var p = this.options.path;
|
||||
this.pathbar.setContent('').addClass('empty');
|
||||
|
||||
Reference in New Issue
Block a user