From dc84b4ccf9f5cf7482f36d5b76ccd5fedaa26a11 Mon Sep 17 00:00:00 2001 From: Rolux Date: Sat, 27 Feb 2010 09:16:58 +0100 Subject: [PATCH] updating css --- build/css/ox.ui.classic.css | 5 ++--- build/js/ox.ui.js | 19 +++++++++++++------ demos/test/index.html | 4 +--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/build/css/ox.ui.classic.css b/build/css/ox.ui.classic.css index 7d9071dc..1a3e6fd9 100644 --- a/build/css/ox.ui.classic.css +++ b/build/css/ox.ui.classic.css @@ -103,13 +103,12 @@ Forms background: -moz-linear-gradient(top, rgb(224, 224, 224), rgb(255, 255, 255)); background: -webkit-gradient(linear, left top, left bottom, from(rgb(224, 224, 224)), to(rgb(255, 255, 255))); } -.OxThemeClassic textarea.OxInput:focus { +.OxThemeClassic .OxInput:focus { border: 1px solid rgb(160, 160, 160); -moz-box-shadow: 0 0 2px rgb(128, 128, 128); -webkit-box-shadow: 0 0 2px rgb(128, 128, 128); } -.OxThemeClassic input.OxInput.OxPlaceholder, -.OxThemeClassic textarea.OxInput.OxPlaceholder { +.OxThemeClassic .OxInput.OxPlaceholder { color: rgb(160, 160, 160) } diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 65979884..589e9641 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -1734,7 +1734,7 @@ requires highlight: false, id: "", label: "", - labelWidth: 0, + labelWidth: 64, placeholder: "", selected: 0, size: "medium", @@ -1994,16 +1994,23 @@ requires } that.height = function(value) { - var percent = 8 / value * 100; + var stop = 8 / value; if (self.options.type == "textarea") { - that.$element.height(value); + that.$element + .height(value) + .css({ + background: "-moz-linear-gradient(top, rgb(224, 224, 224), rgb(208, 208, 208) " + (stop * 100) + "%, rgb(208, 208, 208) " + (100 - stop * 100) + "%, rgb(192, 192, 192))" + }) + .css({ + background: "-webkit-gradient(linear, left top, left bottom, from(rgb(224, 224, 224)), color-stop(" + stop + ", rgb(208, 208, 208)), color-stop(" + (1 - stop) + ", rgb(208, 208, 208)), to(rgb(192, 192, 192)))" + }); that.$input .height(value) .css({ - background: "-moz-linear-gradient(top, rgb(224, 224, 224), rgb(240, 240, 240) " + percent + "%, rgb(240, 240, 240) " + (100 - percent) + "%, rgb(255, 255, 255))" + background: "-moz-linear-gradient(top, rgb(224, 224, 224), rgb(240, 240, 240) " + (stop * 100) + "%, rgb(240, 240, 240) " + (100 - stop * 100) + "%, rgb(255, 255, 255))" }) .css({ - background: "-webkit-gradient(linear, left top, left bottom, from(rgb(224, 224, 224)), color-stop(" + (percent / 100) + ", rgb(240, 240, 240)), color-stop(" + (1 - percent / 100) + ", rgb(240, 240, 240)), to(rgb(255, 255, 255)))" + background: "-webkit-gradient(linear, left top, left bottom, from(rgb(224, 224, 224)), color-stop(" + stop + ", rgb(240, 240, 240)), color-stop(" + (1 - stop) + ", rgb(240, 240, 240)), to(rgb(255, 255, 255)))" }); } return that; @@ -2012,7 +2019,7 @@ requires that.width = function(value) { that.$element.width(value); that.$input.width(value - (self.options.type == "textarea" ? 0 : 2) - - (self.options.labelWidth ? self.options.labelWidth + 18 : 0) - + (self.options.label ? self.options.labelWidth + 18 : 0) - (self.options.placeholder.length > 1 ? 26 : 0) - (self.options.clear ? 31 : 0)); // fixme: the values above are all weird guesswork diff --git a/demos/test/index.html b/demos/test/index.html index 7a2e940f..38e24d56 100644 --- a/demos/test/index.html +++ b/demos/test/index.html @@ -517,14 +517,12 @@ $("
").appendTo(mainPanel.$element); $("
").appendTo(mainPanel.$element); Ox.Input({ - label: "Label", - labelWidth: 48, + label: "Label" }).width(400).addClass("margin").appendTo(mainPanel); $("
").appendTo(mainPanel.$element); $("
").appendTo(mainPanel.$element); Ox.Input({ label: "Label", - labelWidth: 48, //placeholder: "some\ntext", type: "textarea" }).width(400).height(100).addClass("margin").appendTo(mainPanel);