diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 091bf0cf..45bde767 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -871,6 +871,7 @@ requires that.defaults({foo: x}) sets self.defaults */ self.defaults = defaults; + delete self.options; // fixme: hackish fix for that = OxFoo({}, self).defaults({...}).options({...}) return that; }; that.gainFocus = function() { @@ -907,11 +908,11 @@ requires // options (str, val) or options({str: val, ...}) // translate (str, val) to ({str: val}) args = Ox.makeObject.apply(that, arguments); - // if options have not been set, extend defaults, - // otherwise, extend options /* options = self.options; */ + // if options have not been set, extend defaults, + // otherwise, extend options self.options = $.extend(self.options || self.defaults, args); $.each(args, function(key, value) { self.onChange(key, value); @@ -1322,7 +1323,8 @@ requires that.remove(); that.$layer.remove(); callback(); - }) + }); + return that; } that.disable = function() { @@ -1335,7 +1337,9 @@ requires } that.open = function() { + Ox.print("opening...") that.$layer.appendTo($body); + Ox.print("opening...") that.css({ opacity: 0 }).appendTo(that.$layer).animate({ @@ -1358,11 +1362,52 @@ requires var self = self || {}, that = new Ox.Element("div", self) - .defaults() - .options(); + .defaults({ + items: [] + }) + .options(options || {}); // fixme: the || {} can be done once, in the options function + + $.each(self.options.items, function(i, item) { + + }); + + that.values = function() { + var values = {}; + if (arguments.length == 0) { + $.each(self.options.items, function(i, item) { + values[item.id] = item.val(); + }); + return values; + } else { + $.each(arguments[0], function(key, value) { + + }); + return that; + } + }; + + return that; }; + Ox.FormItem = function(options, self) { + + var self = self || {}, + that = new Ox.Element("", self) + .defaults({ + error: "", + regexp: / /, + size: "medium", + type: "text" + }) + .options(options || {}); + + that.$input = new OxInput(); + + return that; + + } + /* ---------------------------------------------------------------------------- Ox.Button @@ -2225,6 +2270,7 @@ requires that.bindEvent("hide_" + that.menus[position].options("id"), onHideMenu); }); + Ox.print(self.options) if (self.options.extras.length) { that.extras = $("