pandora/static/js/iconDialog.js

42 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2013-03-03 05:04:25 +00:00
'use strict';
2013-03-03 05:06:37 +00:00
pandora.ui.iconDialog = function(options) {
2013-03-03 05:04:25 +00:00
var options = Ox.extend({
closeButton: false,
content: '',
2013-03-03 05:04:25 +00:00
height: 128,
keys: null,
title: '',
2013-03-08 09:43:23 +00:00
width: 368,
2013-03-03 05:04:25 +00:00
}, options),
that = Ox.Dialog({
buttons: options.buttons,
2013-03-03 05:34:44 +00:00
closeButton: options.closeButton,
2013-03-03 05:04:25 +00:00
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 05:08:57 +00:00
.css({position: 'absolute', left: '96px', top: '16px', width: options.width - 112 + 'px'})
.html(options.content)
2013-03-03 05:04:25 +00:00
),
2013-03-03 05:07:53 +00:00
fixedSize: true,
2013-03-03 05:04:25 +00:00
height: options.height,
keys: options.keys,
removeOnClose: true,
title: options.title,
width: options.width
});
return that;
};