|
|
@ -1400,20 +1400,21 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
common.createFileDialog = function (cfg) {
|
|
|
|
common.createFileDialog = function (cfg) {
|
|
|
|
var $body = cfg.$body || $('body');
|
|
|
|
var $body = cfg.$body || $('body');
|
|
|
|
var $block = $body.find('#fileDialog');
|
|
|
|
var $blockContainer = $body.find('#fileDialog');
|
|
|
|
if (!$block.length) {
|
|
|
|
if (!$blockContainer.length) {
|
|
|
|
$block = $('<div>', {id: "fileDialog"}).appendTo($body);
|
|
|
|
$blockContainer = $('<div>', {id: "fileDialog"}).appendTo($body);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$block.html('');
|
|
|
|
$blockContainer.html('');
|
|
|
|
|
|
|
|
var $block = $('<div>', {id: "modal"}).appendTo($blockContainer);
|
|
|
|
$('<span>', {
|
|
|
|
$('<span>', {
|
|
|
|
'class': 'close fa fa-times',
|
|
|
|
'class': 'close fa fa-times',
|
|
|
|
'title': Messages.filePicker_close
|
|
|
|
'title': Messages.filePicker_close
|
|
|
|
}).click(function () {
|
|
|
|
}).click(function () {
|
|
|
|
$block.hide();
|
|
|
|
$blockContainer.hide();
|
|
|
|
}).appendTo($block);
|
|
|
|
}).appendTo($block);
|
|
|
|
var $description = $('<p>').text(Messages.filePicker_description);
|
|
|
|
var $description = $('<p>').text(Messages.filePicker_description);
|
|
|
|
$block.append($description);
|
|
|
|
$block.append($description);
|
|
|
|
var $filter = $('<p>').appendTo($block);
|
|
|
|
var $filter = $('<p>', {'class': 'form'}).appendTo($block);
|
|
|
|
var $container = $('<span>', {'class': 'fileContainer'}).appendTo($block);
|
|
|
|
var $container = $('<span>', {'class': 'fileContainer'}).appendTo($block);
|
|
|
|
var updateContainer = function () {
|
|
|
|
var updateContainer = function () {
|
|
|
|
$container.html('');
|
|
|
|
$container.html('');
|
|
|
@ -1426,11 +1427,15 @@ define([
|
|
|
|
if (filter && name.toLowerCase().indexOf(filter.toLowerCase()) === -1) {
|
|
|
|
if (filter && name.toLowerCase().indexOf(filter.toLowerCase()) === -1) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var $span = $('<span>', {'class': 'element'}).appendTo($container);
|
|
|
|
var $span = $('<span>', {
|
|
|
|
var $inner = $('<span>').text(name);
|
|
|
|
'class': 'element',
|
|
|
|
$span.append($inner).click(function () {
|
|
|
|
'title': name,
|
|
|
|
|
|
|
|
}).appendTo($container);
|
|
|
|
|
|
|
|
$span.append($('<i>', {'class': 'fa fa-file-text-o'}));
|
|
|
|
|
|
|
|
$span.append(name);
|
|
|
|
|
|
|
|
$span.click(function () {
|
|
|
|
if (typeof cfg.onSelect === "function") { cfg.onSelect(data.href); }
|
|
|
|
if (typeof cfg.onSelect === "function") { cfg.onSelect(data.href); }
|
|
|
|
$block.hide();
|
|
|
|
$blockContainer.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -1446,13 +1451,13 @@ define([
|
|
|
|
//$filter.append(' '+Messages.or+' ');
|
|
|
|
//$filter.append(' '+Messages.or+' ');
|
|
|
|
var data = {FM: cfg.data.FM};
|
|
|
|
var data = {FM: cfg.data.FM};
|
|
|
|
$filter.append(common.createButton('upload', false, data, function () {
|
|
|
|
$filter.append(common.createButton('upload', false, data, function () {
|
|
|
|
$block.hide();
|
|
|
|
$blockContainer.hide();
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
updateContainer();
|
|
|
|
updateContainer();
|
|
|
|
$body.keydown(function (e) {
|
|
|
|
$body.keydown(function (e) {
|
|
|
|
if (e.which === 27) { $block.hide(); }
|
|
|
|
if (e.which === 27) { $blockContainer.hide(); }
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$block.show();
|
|
|
|
$blockContainer.show();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|