From 1083a324dc11d8828c926037a30dd68af8439d39 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 15 Aug 2011 16:11:13 +0200 Subject: [PATCH] minor fixes --- source/Ox.UI/js/List/Ox.List.js | 38 ++++++++++++----------- source/Ox.UI/js/Window/Ox.Dialog.js | 17 +++++++--- source/Ox.UI/themes/modern/css/modern.css | 5 +-- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index a2aad23a..1159e34e 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -922,6 +922,7 @@ Ox.List = function(options, self) { } function preview() { + Ox.print('preview selected', !self.preview, self.options.selected) if (self.options.selected.length) { self.preview = !self.preview; if (self.preview) { @@ -1376,6 +1377,25 @@ Ox.List = function(options, self) { updatePositions(); } + /*@ + closePreview to be called when preview is closed externally + () -> the list + @*/ + that.closePreview = function() { + Ox.print('-- closePreview --') + self.preview = false; + return that; + }; + + /*@ + clearCache empty list cache + () -> the list + @*/ + that.clearCache = function() { // fixme: was used by TextList resizeColumn, now probably no longer necessary + self.$pages = []; + return that; + }; + /*@ editItem turn item into edit form (pos) -> edit item at position @@ -1426,24 +1446,6 @@ Ox.List = function(options, self) { } } - /*@ - clearCache empty list cache - () -> the list - @*/ - that.clearCache = function() { // fixme: was used by TextList resizeColumn, now probably no longer necessary - self.$pages = []; - return that; - }; - - /*@ - closePreview close preview - () -> the list - @*/ - that.closePreview = function() { - self.preview = false; - return that; - }; - /*@ paste paste data (data) -> the list diff --git a/source/Ox.UI/js/Window/Ox.Dialog.js b/source/Ox.UI/js/Window/Ox.Dialog.js index 1759f770..559c654a 100644 --- a/source/Ox.UI/js/Window/Ox.Dialog.js +++ b/source/Ox.UI/js/Window/Ox.Dialog.js @@ -46,10 +46,6 @@ Ox.Dialog = function(options, self) { self.hasButtons = !!self.options.buttons.length; 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.options.maximizeButton ? 20 : 0); @@ -595,6 +591,9 @@ Ox.Dialog = function(options, self) { self.setOption = function(key, value) { if (key == 'content') { setContent(); + } else if (key == 'height') { + setMinAndMax(); + setCSS({height: value}); } else if (key == 'title') { self.$title.animate({ opacity: 0 @@ -603,6 +602,9 @@ Ox.Dialog = function(options, self) { opacity: 1 }, 50); }); + } else if (key == 'height') { + setMinAndMax(); + setCSS({width: value}); } }; @@ -623,6 +625,7 @@ Ox.Dialog = function(options, self) { that.loseFocus(); Ox.UI.$window.unbind({mouseup: mouseupLayer}); } + that.triggerEvent('close'); return that; }; @@ -631,6 +634,10 @@ Ox.Dialog = function(options, self) { }; that.open = function() { + self.initialHeight = self.options.height; + self.initialWidth = self.options.width; + self.initialMaxHeight = self.options.maxHeight; + self.initialMaxWidth = self.options.maxWidth; setMinAndMax(); center(); reset(); @@ -666,6 +673,8 @@ Ox.Dialog = function(options, self) { self.options.height = height; setMinAndMax(); if (self.maximized) { + self.originalWidth = width; + self.originalHeight = height; self.options.width = self.options.maxWidth; self.options.height = self.options.maxHeight; } diff --git a/source/Ox.UI/themes/modern/css/modern.css b/source/Ox.UI/themes/modern/css/modern.css index 087ffa5c..0529be7f 100644 --- a/source/Ox.UI/themes/modern/css/modern.css +++ b/source/Ox.UI/themes/modern/css/modern.css @@ -81,9 +81,6 @@ Dialog -moz-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 { 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 { - background: rgba(48, 48, 48, 0.96); + background: rgba(48, 48, 48, 0.95); } .OxThemeModern .OxLayer {