Ox.Progressbar: make tooltips optional

This commit is contained in:
rolux 2012-04-14 13:54:45 +02:00
parent 23b583098e
commit 3bfd8be160
2 changed files with 6 additions and 3 deletions

View file

@ -65,6 +65,7 @@ Ox.load('UI', function() {
showPercent: true, showPercent: true,
showRestartButton: true, showRestartButton: true,
showTime: true, showTime: true,
showTooltips: true,
width: progressWidth width: progressWidth
}) })
.attr({id: 'progress2'}) .attr({id: 'progress2'})

View file

@ -14,6 +14,7 @@ Ox.Progressbar <f> Progress Bar
showPercent <b|false> If true, show progress in percent showPercent <b|false> If true, show progress in percent
showRestartButton <b|false> If true, show restart button showRestartButton <b|false> If true, show restart button
showTime <b|false> If true, show remaining time showTime <b|false> If true, show remaining time
showTooltips <b|false> If true, buttons have tooltips
width <n|256> Width in px width <n|256> Width in px
self <o|{}> Shared private variable self <o|{}> Shared private variable
cancel <!> cancelled cancel <!> cancelled
@ -35,6 +36,7 @@ Ox.Progressbar = function(options, self) {
showPercent: false, showPercent: false,
showRestartButton: false, showRestartButton: false,
showTime: false, showTime: false,
showTooltips: false,
width: 256 width: 256
}) })
.options(options || {}) .options(options || {})
@ -77,7 +79,7 @@ Ox.Progressbar = function(options, self) {
if (self.options.showPauseButton) { if (self.options.showPauseButton) {
self.$pauseButton = Ox.Button({ self.$pauseButton = Ox.Button({
style: 'symbol', style: 'symbol',
tooltip: ['Pause', 'Resume'], tooltip: self.options.showTooltips ? ['Pause', 'Resume'] : '',
type: 'image', type: 'image',
value: !self.options.paused ? 'pause' : 'redo', value: !self.options.paused ? 'pause' : 'redo',
values: ['pause', 'redo'] values: ['pause', 'redo']
@ -93,12 +95,12 @@ Ox.Progressbar = function(options, self) {
style: 'symbol', style: 'symbol',
type: 'image' type: 'image'
}, self.options.showRestartButton ? { }, self.options.showRestartButton ? {
tooltip: ['Cancel', 'Restart'], tooltip: self.options.showTooltips ? ['Cancel', 'Restart'] : '',
value: 'close', value: 'close',
values: ['close', 'redo'] values: ['close', 'redo']
} : { } : {
title: 'close', title: 'close',
tooltip: 'Cancel' tooltip: self.options.showTooltips ? 'Cancel' : ''
})) }))
.bindEvent({ .bindEvent({
click: toggleCancelled click: toggleCancelled