fix document import
This commit is contained in:
parent
272810b9c2
commit
ce234bdea5
4 changed files with 19 additions and 10 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
pandora.ui.importDocumentsDialog = function() {
|
||||
|
||||
var dialogHeight = 100,
|
||||
var dialogHeight = 128 + 16,
|
||||
dialogWidth = 512 + 16,
|
||||
formWidth = getFormWidth(),
|
||||
|
||||
|
|
@ -10,8 +10,9 @@ pandora.ui.importDocumentsDialog = function() {
|
|||
$content = Ox.Element(),
|
||||
value,
|
||||
$input = [
|
||||
Ox.TextArea({
|
||||
labelWidth: 96,
|
||||
Ox.Input({
|
||||
type: 'textarea',
|
||||
height: 128,
|
||||
width: 512
|
||||
}).css({
|
||||
margin: '8px'
|
||||
|
|
@ -35,7 +36,7 @@ pandora.ui.importDocumentsDialog = function() {
|
|||
}
|
||||
}),
|
||||
$button = Ox.Button({
|
||||
disabled: true,
|
||||
disabled: false,
|
||||
id: 'import',
|
||||
title: Ox._('Import URLs')
|
||||
})
|
||||
|
|
@ -73,10 +74,16 @@ pandora.ui.importDocumentsDialog = function() {
|
|||
pandora.api.importDocuments({
|
||||
urls: urls
|
||||
}, function(result) {
|
||||
Ox.Request.clearCache()
|
||||
if (result.data.taskId) {
|
||||
pandora.wait(result.data.taskId, function(result) {
|
||||
that.close();
|
||||
}
|
||||
if (pandora.user.ui.section == 'documents' && !pandora.user.ui.document.length) {
|
||||
pandora.$ui.list.reloadList()
|
||||
} else {
|
||||
pandora.URL.push('/documents/grid/created')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.options({content: 'Failed'});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ pandora.localInit = function() {
|
|||
$item = Ox.MenuButton({
|
||||
items: [
|
||||
].concat(pandora.user.level == 'admin' ? [
|
||||
] : [], [
|
||||
] : [], pandora.user.level == 'gurest' ? [] : [
|
||||
{id: 'import_documents', title: 'Import Documents...'},
|
||||
]),
|
||||
style: 'rounded',
|
||||
|
|
@ -37,7 +37,7 @@ pandora.localInit = function() {
|
|||
}).css(css).bindEvent({
|
||||
click: function(data) {
|
||||
if (data.id == 'import_documents') {
|
||||
pandora.ui.importDocumentsDialog().open()
|
||||
pandora.ui.importDocumentsDialog().open();
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue