Merge branch 'staging' into slide2

This commit is contained in:
yflory
2017-09-08 18:21:38 +02:00
6 changed files with 134 additions and 104 deletions

View File

@@ -90,7 +90,7 @@ define([
// Description
var text = Messages.filePicker_description;
if (types.length === 1 && types[0] !== 'file') {
if (types && types.length === 1 && types[0] !== 'file') {
// Should be Templates
text = Messages.selectTemplate;
}
@@ -117,7 +117,8 @@ define([
// Update the files list when needed
updateContainer = function () {
$container.html('');
var filter = $filter.find('.cp-filepicker-filter').val().trim();
var $input = $filter.find('.cp-filepicker-filter');
var filter = $input.val().trim();
var todo = function (err, list) {
if (err) { return void console.error(err); }
Object.keys(list).forEach(function (id) {
@@ -136,6 +137,7 @@ define([
if (typeof onSelect === "function") { onSelect(data.href); }
});
});
$input.focus();
};
common.getFilesList(filters, todo);
};