From b0e5e906f57e7062744c2c840278f651a3ff35f7 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 12 May 2011 05:29:35 +0200 Subject: [PATCH] fix OxText class in CSS --- source/Ox.UI/css/Ox.UI.css | 86 ++++++++++----------- source/Ox.UI/js/Core/Ox.Container.js | 2 +- source/Ox.UI/js/Core/Ox.DocPage.js | 2 +- source/Ox.UI/js/Core/Ox.DocPanel.js | 27 ++++--- source/Ox.UI/js/List/Ox.TreeList.js | 4 +- source/Ox.UI/themes/classic/css/classic.css | 27 +++---- source/Ox.UI/themes/modern/css/modern.css | 27 ++++--- 7 files changed, 93 insertions(+), 82 deletions(-) diff --git a/source/Ox.UI/css/Ox.UI.css b/source/Ox.UI/css/Ox.UI.css index 3cab5cb8..420bda26 100644 --- a/source/Ox.UI/css/Ox.UI.css +++ b/source/Ox.UI/css/Ox.UI.css @@ -254,6 +254,49 @@ Dialog cursor: se-resize; } +/* +================================================================================ +Document +================================================================================ +*/ + +.OxDocument { + padding: 8px; + -moz-user-select: text; + -webkit-user-select: text; +} +.OxDocument div { + border-style: solid; + border-width: 0; + //font-size: 12px; + line-height: 15px; + -moz-user-select: text; + -webkit-user-select: text; +} +.OxDocument code { + font-family: Menlo, Monaco, DejaVu Sans Mono, Bitstream Vera Sans Mono, Consolas, Lucida Console; +} +.OxDocument h1 { + font-weight: bold; + font-size: 16px; + line-height: 20px; +} +.OxDocument table { + border-spacing: 0; + //border: 1px solid red; +} +.OxDocument td { + padding: 0 4px 0 4px; + //border: 1px solid rgb(128, 128, 128); + vertical-align: top; +} +.OxDocument td:first-child { + padding-left: 0; +} +.OxDocument td:last-child { + padding-right: 0; +} + /* ================================================================================ Documentation @@ -1475,49 +1518,6 @@ SyntaxHightlighter //-webkit-user-select: none; } -/* -================================================================================ -Text -================================================================================ -*/ - -.OxText { - padding: 8px; - -moz-user-select: text; - -webkit-user-select: text; -} -.OxText div { - border-style: solid; - border-width: 0; - font-size: 12px; - line-height: 16px; - -moz-user-select: text; - -webkit-user-select: text; -} -.OxText code { - font-family: Menlo, Monaco, DejaVu Sans Mono, Bitstream Vera Sans Mono, Consolas, Lucida Console; -} -.OxText h1 { - font-weight: bold; - font-size: 16px; - line-height: 20px; -} -.OxText table { - border-spacing: 0; - //border: 1px solid red; -} -.OxText td { - padding: 0 4px 0 4px; - //border: 1px solid rgb(128, 128, 128); - vertical-align: top; -} -.OxText td:first-child { - padding-left: 0; -} -.OxText td:last-child { - padding-right: 0; -} - /* ================================================================================ Video diff --git a/source/Ox.UI/js/Core/Ox.Container.js b/source/Ox.UI/js/Core/Ox.Container.js index 0fd3b6c5..93d9e334 100644 --- a/source/Ox.UI/js/Core/Ox.Container.js +++ b/source/Ox.UI/js/Core/Ox.Container.js @@ -9,7 +9,7 @@ Ox.Container = function(options, self) { var that = new Ox.Element({}, self) .options(options || {}) .addClass('OxContainer'); - that.$content = new Ox.Element({}) + that.$content = new Ox.Element({}, self) // fixme: passing self twice?? .options(options || {}) .addClass('OxContent') .appendTo(that); diff --git a/source/Ox.UI/js/Core/Ox.DocPage.js b/source/Ox.UI/js/Core/Ox.DocPage.js index d2d84dee..2b5711f4 100644 --- a/source/Ox.UI/js/Core/Ox.DocPage.js +++ b/source/Ox.UI/js/Core/Ox.DocPage.js @@ -6,7 +6,7 @@ Ox.DocPage = function(options, self) { item: {} }) .options(options || {}) - .addClass('OxDocPage OxText') + .addClass('OxDocPage OxDocument') .css({ overflow: 'auto' }); diff --git a/source/Ox.UI/js/Core/Ox.DocPanel.js b/source/Ox.UI/js/Core/Ox.DocPanel.js index bfb95101..49d209ef 100644 --- a/source/Ox.UI/js/Core/Ox.DocPanel.js +++ b/source/Ox.UI/js/Core/Ox.DocPanel.js @@ -110,6 +110,12 @@ Ox.DocPanel = function(options, self) { .bindEvent({ select: selectItem }); + // fixme + /* + var $foo = Ox.Container(); + self.$list.appendTo($foo); + that.$element.replaceElement(0, $foo); + */ that.$element.replaceElement(0, self.$list); } } @@ -126,15 +132,18 @@ Ox.DocPanel = function(options, self) { } function selectItem(data) { - var selected = data.ids[0]; - if (selected[0] != '_') { - self.$page = Ox.DocPage({ - item: getItemByName(selected) - }); - that.$element.replaceElement(1, self.$page); - that.triggerEvent('select', { - id: selected - }); + var selected; + if (data.ids.length) { + selected = data.ids[0]; + if (selected[0] != '_') { + self.$page = Ox.DocPage({ + item: getItemByName(selected) + }); + that.$element.replaceElement(1, self.$page); + that.triggerEvent('select', { + id: selected + }); + } } } diff --git a/source/Ox.UI/js/List/Ox.TreeList.js b/source/Ox.UI/js/List/Ox.TreeList.js index 257cc145..388faac1 100644 --- a/source/Ox.UI/js/List/Ox.TreeList.js +++ b/source/Ox.UI/js/List/Ox.TreeList.js @@ -31,7 +31,7 @@ Ox.TreeList = function(options, self) { itemWidth: self.options.width, max: self.options.max, min: self.options.min, - unique: 'id', + unique: 'id' }, $.extend({}, self)) .addClass('OxTextList OxTreeList') .css({ @@ -192,6 +192,8 @@ Ox.TreeList = function(options, self) { self.setOption = function(key, value) { if (key == 'data') { + } else if (key == 'width') { + } }; diff --git a/source/Ox.UI/themes/classic/css/classic.css b/source/Ox.UI/themes/classic/css/classic.css index c734d584..e82b22ac 100644 --- a/source/Ox.UI/themes/classic/css/classic.css +++ b/source/Ox.UI/themes/classic/css/classic.css @@ -60,6 +60,20 @@ Dialog background: rgb(255, 255, 255); } +/* +================================================================================ +Document +================================================================================ +*/ + +.OxThemeClassic .OxDocument code { + color: rgb(0, 0, 128); + //background: rgb(255, 255, 255); +} +.OxThemeClassic .OxDocument div { + border-color: rgb(192, 192, 192); +} + /* ================================================================================ Forms @@ -429,19 +443,6 @@ SyntaxHighlighter background: rgb(255, 128, 128); } -/* -================================================================================ -Text -================================================================================ -*/ - -.OxThemeClassic .OxText code { - color: rgb(0, 0, 128); -} -.OxThemeClassic .OxText div { - border-color: rgb(192, 192, 192); -} - /* ================================================================================ Video diff --git a/source/Ox.UI/themes/modern/css/modern.css b/source/Ox.UI/themes/modern/css/modern.css index 7911ec32..51ad1389 100644 --- a/source/Ox.UI/themes/modern/css/modern.css +++ b/source/Ox.UI/themes/modern/css/modern.css @@ -84,6 +84,19 @@ Dialog } +/* +================================================================================ +Document +================================================================================ +*/ + +.OxThemeModern .OxDocument code { + color: rgb(128, 128, 255); +} +.OxThemeModern .OxDocument div { + border-color: rgb(64, 64, 64); +} + /* ================================================================================ Forms @@ -433,20 +446,6 @@ SyntaxHighlighter background: rgb(255, 255, 255); } -/* -================================================================================ -Text -================================================================================ -*/ - -.OxThemeModern .OxText code { - color: rgb(128, 128, 255); -} -.OxThemeModern .OxText div { - border-color: rgb(64, 64, 64); -} - - /* ================================================================================ Video