use new form element syntax

This commit is contained in:
rolux 2011-12-22 12:54:30 +05:30
parent e965ae21c2
commit 68f9b40a80
7 changed files with 18 additions and 18 deletions

View file

@ -133,11 +133,11 @@ function constructList() {
.html(app.actions[id].code[1].replace('/\n/<br>\n/g')) .html(app.actions[id].code[1].replace('/\n/<br>\n/g'))
.hide(); .hide();
var $button = new Ox.Button({ var $button = new Ox.Button({
title: [ type: "image"
values: [
{id: "one", title: "right"}, {id: "one", title: "right"},
{id: "two", title: "down"}, {id: "two", title: "down"},
], ],
type: "image"
}) })
.addClass("margin") .addClass("margin")
.click(function() { $code.toggle()}) .click(function() { $code.toggle()})

View file

@ -3,7 +3,7 @@
pandora.ui.allItems = function() { pandora.ui.allItems = function() {
var that = Ox.Element() var that = Ox.Element()
.addClass('OxSelectable' + (pandora.user.ui._list ? '' : ' OxSelected')) .addClass('OxSelectableElement' + (pandora.user.ui._list ? '' : ' OxSelected'))
.css({ .css({
height: '16px', height: '16px',
cursor: 'default', cursor: 'default',

View file

@ -66,9 +66,7 @@ pandora.ui.contactForm = function() {
.css({width: width + 'px'}) .css({width: width + 'px'})
.bindEvent({ .bindEvent({
validate: function(data) { validate: function(data) {
$sendButton.options({ $sendButton.options({disabled: !data.valid});
disabled: !data.valid
});
} }
}) })
.appendTo(that), .appendTo(that),

View file

@ -279,7 +279,7 @@ pandora.ui.folderList = function(id) {
} else if (id == 'favorite' || (id == 'featured' && pandora.user.level == 'admin')) { } else if (id == 'favorite' || (id == 'featured' && pandora.user.level == 'admin')) {
// this makes the button trigger a change event, // this makes the button trigger a change event,
// which is already being handled in folders.js // which is already being handled in folders.js
pandora.$ui.manageListsButton[id].options({selected: true}); pandora.$ui.manageListsButton[id].options({value: true});
/* /*
if (!pandora.site.sectionFolders.items[i].showBrowser) { if (!pandora.site.sectionFolders.items[i].showBrowser) {
pandora.site.sectionFolders.items[i].showBrowser = true; pandora.site.sectionFolders.items[i].showBrowser = true;

View file

@ -3,12 +3,13 @@
pandora.ui.sectionButtons = function() { pandora.ui.sectionButtons = function() {
var that = Ox.ButtonGroup({ var that = Ox.ButtonGroup({
buttons: [ buttons: [
{id: 'items', selected: pandora.user.ui.section == 'items', title: pandora.site.itemName.plural}, {id: 'items', title: pandora.site.itemName.plural},
{id: 'edits', selected: pandora.user.ui.section == 'edits', title: 'Edits', disabled: true}, {id: 'edits', title: 'Edits', disabled: true},
{id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts', disabled: true} {id: 'texts', title: 'Texts', disabled: true}
], ],
id: 'sectionButtons', id: 'sectionButtons',
selectable: true selectable: true,
value: pandora.user.ui.section
}).css({ }).css({
float: 'left', float: 'left',
margin: '4px' margin: '4px'

View file

@ -5,10 +5,11 @@ pandora.ui.sectionSelect = function() {
var that = Ox.Select({ var that = Ox.Select({
id: 'sectionSelect', id: 'sectionSelect',
items: [ items: [
{checked: pandora.user.ui.section == 'items', id: 'items', title: pandora.site.itemName.plural}, {id: 'items', title: pandora.site.itemName.plural},
{checked: pandora.user.ui.section == 'edits', id: 'edits', title: 'Edits', disabled: true}, {id: 'edits', title: 'Edits', disabled: true},
{checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts', disabled: true} {id: 'texts', title: 'Texts', disabled: true}
] ],
value: pandora.user.ui.section
}).css({ }).css({
float: 'left', float: 'left',
margin: '4px' margin: '4px'

View file

@ -5,9 +5,9 @@ pandora.ui.sectionbar = function(mode) {
size: 24 size: 24
}) })
.append( .append(
mode == 'buttons' ? mode == 'buttons'
pandora.$ui.sectionButtons = pandora.ui.sectionButtons() : ? pandora.$ui.sectionButtons = pandora.ui.sectionButtons()
pandora.$ui.sectionSelect = pandora.ui.sectionSelect() : pandora.$ui.sectionSelect = pandora.ui.sectionSelect()
); );
that.toggle = function() { that.toggle = function() {