support disalogs without titlebar, i.e. preview vidieo player

This commit is contained in:
j 2026-01-14 21:39:36 +00:00
commit ec5b050496

View file

@ -19,6 +19,7 @@ Ox.Dialog = function(options, self) {
var that = Ox.Element({}, self)
.defaults({
buttons: [],
borderless: false,
controlsBottom: [],
controlsTop: [],
closeButton: false,
@ -73,7 +74,7 @@ Ox.Dialog = function(options, self) {
.appendTo(Ox.Fullscreen.element ? Ox.Fullscreen.element : Ox.$body);
self.hasButtons = !!self.options.buttons.length;
self.barsHeight = 24 + 24 * self.hasButtons;
self.barsHeight = !self.options.borderless*24 + 24 * self.hasButtons;
self.initialMaxHeight = self.options.maxHeight;
self.initialMaxWidth = self.options.maxWidth;
self.titleMargin = 8 + (self.options.closeButton ? 20 : 0)
@ -94,7 +95,9 @@ Ox.Dialog = function(options, self) {
size: 24
})
.addClass('OxTitlebar')
.appendTo(that);
if (!self.options.borderless) {
self.$titlebar.appendTo(that);
}
if (self.options.closeButton) {
self.$closeButton = Ox.Button({
@ -605,6 +608,13 @@ Ox.Dialog = function(options, self) {
borderBottomRightRadius: '8px'
})
.appendTo(that);
if (self.options.borderless) {
self.$content.css({
top: 0,
borderTopLeftRadius: '8px',
borderTopRightRadius: '8px'
})
}
!isImage && self.$content.append(
self.options.content.css(self.hasButtons ? {} : {
borderBottomLeftRadius: '8px',