minor fixes

This commit is contained in:
rolux 2011-08-15 16:11:13 +02:00
parent ee93ed673e
commit 1083a324dc
3 changed files with 34 additions and 26 deletions

View file

@ -922,6 +922,7 @@ Ox.List = function(options, self) {
} }
function preview() { function preview() {
Ox.print('preview selected', !self.preview, self.options.selected)
if (self.options.selected.length) { if (self.options.selected.length) {
self.preview = !self.preview; self.preview = !self.preview;
if (self.preview) { if (self.preview) {
@ -1376,6 +1377,25 @@ Ox.List = function(options, self) {
updatePositions(); updatePositions();
} }
/*@
closePreview <f> to be called when preview is closed externally
() -> <o> the list
@*/
that.closePreview = function() {
Ox.print('-- closePreview --')
self.preview = false;
return that;
};
/*@
clearCache <f> empty list cache
() -> <o> the list
@*/
that.clearCache = function() { // fixme: was used by TextList resizeColumn, now probably no longer necessary
self.$pages = [];
return that;
};
/*@ /*@
editItem <f> turn item into edit form editItem <f> turn item into edit form
(pos) -> <u> edit item at position (pos) -> <u> edit item at position
@ -1426,24 +1446,6 @@ Ox.List = function(options, self) {
} }
} }
/*@
clearCache <f> empty list cache
() -> <o> the list
@*/
that.clearCache = function() { // fixme: was used by TextList resizeColumn, now probably no longer necessary
self.$pages = [];
return that;
};
/*@
closePreview <f> close preview
() -> <o> the list
@*/
that.closePreview = function() {
self.preview = false;
return that;
};
/*@ /*@
paste <f> paste data paste <f> paste data
(data) -> <o> the list (data) -> <o> the list

View file

@ -46,10 +46,6 @@ Ox.Dialog = function(options, self) {
self.hasButtons = !!self.options.buttons.length; self.hasButtons = !!self.options.buttons.length;
self.barsHeight = 24 + 24 * self.hasButtons; self.barsHeight = 24 + 24 * self.hasButtons;
self.initialHeight = self.options.height;
self.initialWidth = self.options.width;
self.initialMaxHeight = self.options.maxHeight;
self.initialMaxWidth = self.options.maxWidth;
self.titleMargin = 8 + (self.options.closeButton ? 20 : 0) self.titleMargin = 8 + (self.options.closeButton ? 20 : 0)
+ (self.options.maximizeButton ? 20 : 0); + (self.options.maximizeButton ? 20 : 0);
@ -595,6 +591,9 @@ Ox.Dialog = function(options, self) {
self.setOption = function(key, value) { self.setOption = function(key, value) {
if (key == 'content') { if (key == 'content') {
setContent(); setContent();
} else if (key == 'height') {
setMinAndMax();
setCSS({height: value});
} else if (key == 'title') { } else if (key == 'title') {
self.$title.animate({ self.$title.animate({
opacity: 0 opacity: 0
@ -603,6 +602,9 @@ Ox.Dialog = function(options, self) {
opacity: 1 opacity: 1
}, 50); }, 50);
}); });
} else if (key == 'height') {
setMinAndMax();
setCSS({width: value});
} }
}; };
@ -623,6 +625,7 @@ Ox.Dialog = function(options, self) {
that.loseFocus(); that.loseFocus();
Ox.UI.$window.unbind({mouseup: mouseupLayer}); Ox.UI.$window.unbind({mouseup: mouseupLayer});
} }
that.triggerEvent('close');
return that; return that;
}; };
@ -631,6 +634,10 @@ Ox.Dialog = function(options, self) {
}; };
that.open = function() { that.open = function() {
self.initialHeight = self.options.height;
self.initialWidth = self.options.width;
self.initialMaxHeight = self.options.maxHeight;
self.initialMaxWidth = self.options.maxWidth;
setMinAndMax(); setMinAndMax();
center(); center();
reset(); reset();
@ -666,6 +673,8 @@ Ox.Dialog = function(options, self) {
self.options.height = height; self.options.height = height;
setMinAndMax(); setMinAndMax();
if (self.maximized) { if (self.maximized) {
self.originalWidth = width;
self.originalHeight = height;
self.options.width = self.options.maxWidth; self.options.width = self.options.maxWidth;
self.options.height = self.options.maxHeight; self.options.height = self.options.maxHeight;
} }

View file

@ -81,9 +81,6 @@ Dialog
-moz-box-shadow: 2px 2px 8px rgba(0, 0, 0, 1); -moz-box-shadow: 2px 2px 8px rgba(0, 0, 0, 1);
-webkit-box-shadow: 2px 2px 8px rgba(0, 0, 0, 1); -webkit-box-shadow: 2px 2px 8px rgba(0, 0, 0, 1);
} }
.OxThemeModern .OxDialog .OxContent {
background: rgba(48, 48, 48, 0.95);
}
.OxThemeModern .OxDialog .OxBar { .OxThemeModern .OxDialog .OxBar {
background: -moz-linear-gradient(top, rgba(64, 64, 64, 0.95), rgba(32, 32, 32, 0.95)); background: -moz-linear-gradient(top, rgba(64, 64, 64, 0.95), rgba(32, 32, 32, 0.95));
@ -91,7 +88,7 @@ Dialog
} }
.OxThemeModern .OxDialog .OxContent { .OxThemeModern .OxDialog .OxContent {
background: rgba(48, 48, 48, 0.96); background: rgba(48, 48, 48, 0.95);
} }
.OxThemeModern .OxLayer { .OxThemeModern .OxLayer {