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() {
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'))
.css({
height: '16px',
@ -56,16 +58,27 @@ pandora.ui.allItems = function() {
.appendTo(that);
Ox.Button({
style: 'symbol',
title: 'click',
title: 'add',
tooltip: canAddItems ? 'Add ' + pandora.site.itemName.singular : ''
type: 'image'
})
.css({opacity: 0.25})
.css({opacity: canAddItems ? 1 : 0.25})
.bindEvent({
click: pandora.addItem
})
.appendTo(that);
Ox.Button({
style: 'symbol',
title: 'upload',
tooltip: canUploadVideo ? 'Upload Video...' : '',
type: 'image'
})
.css({opacity: canUploadVideo ? 1 : 0.25})
.bindEvent({
click: function() {
pandora.$ui.uploadDialog = pandora.ui.uploadDialog().open();
}
})
.appendTo(that);
pandora.api.find({
query: {conditions: [], operator: '&'}
@ -79,6 +92,7 @@ pandora.ui.allItems = function() {
tooltip: 'HTML',
type: 'image'
})
.css({opacity: 0.25})
.appendTo(that);
Ox.Button({
style: 'symbol',
@ -86,6 +100,7 @@ pandora.ui.allItems = function() {
tooltip: 'Help',
type: 'image'
})
.css({opacity: 0.25})
.appendTo(that);
}