openmedialibrary/static/js/findDialog.js

62 lines
1.9 KiB
JavaScript
Raw Normal View History

2014-05-14 09:57:11 +00:00
'use strict';
oml.ui.findDialog = function() {
var ui = oml.user.ui,
2016-01-14 08:41:52 +00:00
that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'done',
style: 'squared',
title: Ox._('Done')
})
.bindEvent({
click: function() {
var list = oml.$ui.findForm.getList();
if (list.save) {
oml.addList({
name: list.name,
query: list.query
});
}
that.close();
2014-05-14 09:57:11 +00:00
}
2016-01-14 08:41:52 +00:00
})
],
closeButton: true,
content: oml.$ui.findForm = oml.ui.findForm().css({margin: '16px'}),
fixedSize: true,
height: 264,
removeOnClose: true,
title: Ox._('Advanced Find'),
width: 648 + Ox.UI.SCROLLBAR_SIZE
})
.bindEvent({
close: function() {
// ...
}
}),
2014-05-14 09:57:11 +00:00
$updateCheckbox = Ox.Checkbox({
2016-01-13 08:20:03 +00:00
style: 'squared',
2014-05-14 09:57:11 +00:00
title: Ox._('Update Results in the Background'),
2016-01-12 04:45:13 +00:00
value: oml.user.ui.updateResults
2014-05-14 09:57:11 +00:00
})
.css({
float: 'left',
margin: '4px'
})
.bindEvent({
change: function(data) {
2016-01-12 04:45:13 +00:00
oml.UI.set({updateResults: data.value});
2014-05-14 09:57:11 +00:00
//data.value && oml.$ui.findForm.updateResults();
}
});
$($updateCheckbox.find('.OxButton')[0]).css({margin: 0});
$(that.find('.OxBar')[1]).append($updateCheckbox);
return that;
};