update all items element

This commit is contained in:
rolux 2013-03-03 12:04:42 +05:30
parent 14ead5ed2d
commit 40a8c23d4f

View file

@ -2,7 +2,9 @@
pandora.ui.allItems = function() { pandora.ui.allItems = function() {
var that = Ox.Element() var canAddItems = !pandora.site.itemRequiresVideo && pandora.site.capabilities.canAddItems[pandora.user.level],
canUploadVideo = pandora.site.capabilities.canAddItems[pandora.user.level],
that = Ox.Element()
.addClass('OxSelectableElement' + (pandora.user.ui._list ? '' : ' OxSelected')) .addClass('OxSelectableElement' + (pandora.user.ui._list ? '' : ' OxSelected'))
.css({ .css({
height: '16px', height: '16px',
@ -56,16 +58,27 @@ pandora.ui.allItems = function() {
.appendTo(that); .appendTo(that);
Ox.Button({ Ox.Button({
style: 'symbol', style: 'symbol',
title: 'click', title: 'add',
tooltip: canAddItems ? 'Add ' + pandora.site.itemName.singular : ''
type: 'image' type: 'image'
}) })
.css({opacity: 0.25}) .css({opacity: canAddItems ? 1 : 0.25})
.bindEvent({
click: pandora.addItem
})
.appendTo(that); .appendTo(that);
Ox.Button({ Ox.Button({
style: 'symbol', style: 'symbol',
title: 'upload', title: 'upload',
tooltip: canUploadVideo ? 'Upload Video...' : '',
type: 'image' type: 'image'
}) })
.css({opacity: canUploadVideo ? 1 : 0.25})
.bindEvent({
click: function() {
pandora.$ui.uploadDialog = pandora.ui.uploadDialog().open();
}
})
.appendTo(that); .appendTo(that);
pandora.api.find({ pandora.api.find({
query: {conditions: [], operator: '&'} query: {conditions: [], operator: '&'}
@ -79,6 +92,7 @@ pandora.ui.allItems = function() {
tooltip: 'HTML', tooltip: 'HTML',
type: 'image' type: 'image'
}) })
.css({opacity: 0.25})
.appendTo(that); .appendTo(that);
Ox.Button({ Ox.Button({
style: 'symbol', style: 'symbol',
@ -86,6 +100,7 @@ pandora.ui.allItems = function() {
tooltip: 'Help', tooltip: 'Help',
type: 'image' type: 'image'
}) })
.css({opacity: 0.25})
.appendTo(that); .appendTo(that);
} }