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,
showRestartButton: true,
showTime: true,
showTooltips: true,
width: progressWidth
})
.attr({id: 'progress2'})

View file

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