pandora/static/js/iconDialog.js

42 lines
1.4 KiB
JavaScript
Raw Normal View History

2013-03-03 10:34:25 +05:30
'use strict';
2013-03-03 10:36:37 +05:30
pandora.ui.iconDialog = function(options) {
2013-03-03 10:34:25 +05:30
var options = Ox.extend({
closeButton: false,
content: '',
2013-03-03 10:34:25 +05:30
height: 128,
keys: null,
title: '',
2013-03-08 09:43:23 +00:00
width: 368,
2013-03-03 10:34:25 +05:30
}, options),
that = Ox.Dialog({
buttons: options.buttons,
2013-03-03 11:04:44 +05:30
closeButton: options.closeButton,
2013-03-03 10:34:25 +05:30
content: Ox.Element()
.append(
$('<img>')
.attr({src: '/static/png/icon.png'})
.css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'})
)
.append(
Ox.isObject(options.content)
? options.content
.css({position: 'absolute', left: '96px', top: '16px', width: options.width - 112 + 'px'})
: $('<div>')
.addClass('OxTextPage')
2013-03-03 10:38:57 +05:30
.css({position: 'absolute', left: '96px', top: '16px', width: options.width - 112 + 'px'})
.html(options.content)
2013-03-03 10:34:25 +05:30
),
2013-03-03 10:37:53 +05:30
fixedSize: true,
2013-03-03 10:34:25 +05:30
height: options.height,
keys: options.keys,
removeOnClose: true,
title: options.title,
width: options.width
});
return that;
};