From 21b505b4c86e2ec7d5cd4873babef19da0b49f83 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 11 Nov 2011 15:48:54 +0000 Subject: [PATCH] allow for getting 'save list' values from filter --- source/Ox.UI/js/Form/Ox.Filter.js | 13 +++++++++++++ source/Ox.UI/js/List/Ox.ListItem.js | 2 +- source/Ox.UI/js/Menu/Ox.MenuItem.js | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.Filter.js b/source/Ox.UI/js/Form/Ox.Filter.js index fa48ff6f..e2272c81 100644 --- a/source/Ox.UI/js/Form/Ox.Filter.js +++ b/source/Ox.UI/js/Form/Ox.Filter.js @@ -181,6 +181,7 @@ Ox.Filter = function(options, self) { }), Ox.Input({ id: 'list', + placeholder: 'Untitled', width: 128 }) ], @@ -823,6 +824,18 @@ Ox.Filter = function(options, self) { that.triggerEvent('change', {query: query}); } + // fixme: is this the best way/name? + that.getList = function() { + if (self.$save) { + var value = self.$save.value(); + return { + save: value[0], + name: value[1], + query: self.options.query + }; + } + }; + return that; }; diff --git a/source/Ox.UI/js/List/Ox.ListItem.js b/source/Ox.UI/js/List/Ox.ListItem.js index f2e07634..a03695c6 100644 --- a/source/Ox.UI/js/List/Ox.ListItem.js +++ b/source/Ox.UI/js/List/Ox.ListItem.js @@ -35,7 +35,7 @@ Ox.ListItem = function(options, self) { function constructItem(update) { var $element = self.options.construct(self.options.data) - .addClass('OxItem LISTITEM') + .addClass('OxItem') .data({ id: self.options.data[self.options.unique], position: self.options.position diff --git a/source/Ox.UI/js/Menu/Ox.MenuItem.js b/source/Ox.UI/js/Menu/Ox.MenuItem.js index f1e93e79..f0c60e6a 100644 --- a/source/Ox.UI/js/Menu/Ox.MenuItem.js +++ b/source/Ox.UI/js/Menu/Ox.MenuItem.js @@ -42,7 +42,7 @@ Ox.MenuItem = function(options, self) { keyboard: parseKeyboard(options.keyboard || self.defaults.keyboard), title: Ox.toArray(options.title || self.defaults.title) })) - .addClass('OxItem' + (self.options.disabled ? ' OxDisabled' : '') + ' MENUITEM') + .addClass('OxItem' + (self.options.disabled ? ' OxDisabled' : '')) /* .attr({ id: Ox.toCamelCase(self.options.menu.options('id') + '/' + self.options.id)