From b60993d06fb1a13773971d1a1efdd3447f8789ae Mon Sep 17 00:00:00 2001 From: Rolux Date: Sat, 27 Feb 2010 09:46:49 +0100 Subject: [PATCH] adding OxLabel --- build/css/ox.ui.classic.css | 5 +++++ build/css/ox.ui.css | 15 ++++++++++++--- build/js/ox.ui.js | 23 +++++++++++++++++++++-- demos/test/index.html | 33 ++++++++++++++++++++++++++++++++- 4 files changed, 70 insertions(+), 6 deletions(-) diff --git a/build/css/ox.ui.classic.css b/build/css/ox.ui.classic.css index 1a3e6fd..dd11ef0 100644 --- a/build/css/ox.ui.classic.css +++ b/build/css/ox.ui.classic.css @@ -59,6 +59,7 @@ Forms .OxThemeClassic .OxButton, .OxThemeClassic .OxInput, +.OxThemeClassic .OxLabel, .OxThemeClassic .OxRange, .OxThemeClassic .OxTrack { border: 1px solid rgb(176, 176, 176); @@ -112,6 +113,10 @@ Forms color: rgb(160, 160, 160) } +.OxThemeClassic .OxLabel { + background: rgb(208, 208, 208); +} + /* ================================================================================ Menus diff --git a/build/css/ox.ui.css b/build/css/ox.ui.css index d66cb0e..eb47d96 100644 --- a/build/css/ox.ui.css +++ b/build/css/ox.ui.css @@ -317,7 +317,7 @@ div.OxInput { div.OxInput.OxMedium { height: 14px; } -div.OxInput > .OxLabel { +div.OxInput > .OxInputLabel { float: left; padding-left: 8px; text-overflow: ellipsis; @@ -337,8 +337,17 @@ input.OxInput { float: left; margin: -1px -1px 0 -1px; } -textarea.OxInput { - +/* +-------------------------------------------------------------------------------- +OxLabel +-------------------------------------------------------------------------------- +*/ +.OxLabel { + height: 14px; + border: 1px; + padding: 0 8px 0 8px; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; } /* -------------------------------------------------------------------------------- diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 589e964..ef2ea08 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -1761,7 +1761,7 @@ requires if (self.options.label) { that.$label = new Ox.Element() - .addClass("OxLabel") + .addClass("OxInputLabel") .width(self.options.labelWidth) .html(self.options.label[0]) .appendTo(that); @@ -1822,7 +1822,7 @@ requires .appendTo(that); } - if (options.autocomplete) { + if (self.options.autocomplete) { that.$input.attr({ autocomplete: "off" }); @@ -2030,6 +2030,25 @@ requires }; + /* + ---------------------------------------------------------------------------- + Ox.Label + ---------------------------------------------------------------------------- + */ + + Ox.Label = function(options, self) { + var self = self || {}, + that = new Ox.Element({}, self) + .defaults({ + id: "", + title: "" + }) + .options(options) + .addClass("OxLabel"); + that.html(self.options.title); + return that; + }; + /* ---------------------------------------------------------------------------- Ox.Range diff --git a/demos/test/index.html b/demos/test/index.html index 38e24d5..7008d27 100644 --- a/demos/test/index.html +++ b/demos/test/index.html @@ -526,7 +526,38 @@ //placeholder: "some\ntext", type: "textarea" }).width(400).height(100).addClass("margin").appendTo(mainPanel); - + $("
").attr({clear: "all"}).appendTo(mainPanel.$element); + Ox.Select({ + id: "selectLabel", + items: [ + { + checked: true, + id: "label1", + title: "Label 1" + }, + { + id: "label2", + title: "Label 2" + }, + { + id: "label3", + title: "Label 3" + } + ] + }).addClass("margin").width(104).appendTo(mainPanel); + Ox.Input().width(200).addClass("margin").appendTo(mainPanel); + $("
").attr({clear: "all"}).appendTo(mainPanel.$element); + Ox.Label({ + title: "Label" + }).width(100).addClass("margin").appendTo(mainPanel); + Ox.Input().width(200).addClass("margin").appendTo(mainPanel); + $("
").attr({clear: "all"}).appendTo(mainPanel.$element); + Ox.Label({ + title: "Label" + }).width(100).addClass("margin").appendTo(mainPanel); + Ox.Input({ + type: "textarea" + }).width(200).height(100).addClass("margin").appendTo(mainPanel); //*/ function openDialog() { var $dialog = new Ox.Dialog({