update edit dialog

This commit is contained in:
rlx 2016-01-12 10:14:33 +05:30
parent a5ec102398
commit 7865ddd95a
1 changed files with 41 additions and 6 deletions

View File

@ -2,13 +2,17 @@
oml.ui.editDialog = function() {
var arrayKeys = [
var ui = oml.user.ui,
arrayKeys = [
'author', 'place', 'publisher', 'language'
],
ids = oml.user.ui.listSelection,
hasChanged = false,
ids = ui.listSelection,
keys = [
'title', 'author', 'place', 'publisher', 'date',
'edition', 'language', 'pages', 'description'
'title', 'author',
'publisher', 'place', 'date',
'series', 'edition', 'language', 'pages',
'categories', 'isbn', 'description', 'tableofcontents'
],
mixed = ' ',
separator = '; ',
@ -21,10 +25,19 @@ oml.ui.editDialog = function() {
var that = Ox.Dialog({
buttons: [
Ox.Button({
style: 'squared',
title: Ox._('Done')
})
.bindEvent({
click: function() {
if (!ui.updateResults && hasChanged) {
oml.$ui.info.updateElement();
oml.$ui.filters.forEach(function($filter) {
$filter.reloadList();
});
oml.$ui.list.reloadList(true);
oml.$ui.browser.reloadList(true);
}
that.close();
}
})
@ -39,7 +52,25 @@ oml.ui.editDialog = function() {
)
]),
width: 512
});
}),
$updateCheckbox = Ox.Checkbox({
style: 'squared',
title: Ox._('Update Results in the Background'),
value: ui.updateResults
})
.css({
float: 'left',
margin: '4px'
})
.bindEvent({
change: function(data) {
oml.UI.set({updateResults: data.value});
}
});
$($updateCheckbox.find('.OxButton')[0]).css({margin: 0});
$(that.find('.OxBar')[1]).append($updateCheckbox);
getMetadata();
@ -78,7 +109,11 @@ oml.ui.editDialog = function() {
: values[0];
});
that.options({
content: oml.ui.infoView(data, isMixed)
content: oml.ui.infoView(data, isMixed).bindEvent({
change: function() {
hasChanged = true;
}
})
});
});
}