openmedialibrary/static/js/coverDialog.js

51 lines
1.3 KiB
JavaScript
Raw Normal View History

2016-01-11 11:26:06 +00:00
'use strict';
oml.ui.coverDialog = function(id, url) {
var $input = Ox.Input({
value: url,
width: 480
})
.css({margin: '16px'})
.bindEvent({
change: function(value) {
that.close();
oml.api.edit({
id: id,
cover: value
}, function(result) {
// ...
});
}
}),
that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'close',
2016-01-13 08:21:32 +00:00
style: 'squared',
2016-01-11 11:26:06 +00:00
title: Ox._('Close')
})
.bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
content: $input,
height: 48,
keys: {escape: 'close', enter: 'close'},
removeOnClose: true,
title: Ox._('Edit Cover URL'),
width: 512
})
.bindEvent({
open: function() {
$input.focusInput(true);
}
});
return that;
};