From 3bfd8be1607c5b51c30549fc4991dbaad0657b21 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 14 Apr 2012 13:54:45 +0200 Subject: [PATCH] Ox.Progressbar: make tooltips optional --- examples/progress/js/example.js | 1 + source/Ox.UI/js/Bar/Ox.Progressbar.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/progress/js/example.js b/examples/progress/js/example.js index dd33c299..274f9bc1 100644 --- a/examples/progress/js/example.js +++ b/examples/progress/js/example.js @@ -65,6 +65,7 @@ Ox.load('UI', function() { showPercent: true, showRestartButton: true, showTime: true, + showTooltips: true, width: progressWidth }) .attr({id: 'progress2'}) diff --git a/source/Ox.UI/js/Bar/Ox.Progressbar.js b/source/Ox.UI/js/Bar/Ox.Progressbar.js index 742e7dfb..6fa3c6d3 100644 --- a/source/Ox.UI/js/Bar/Ox.Progressbar.js +++ b/source/Ox.UI/js/Bar/Ox.Progressbar.js @@ -14,6 +14,7 @@ Ox.Progressbar Progress Bar showPercent If true, show progress in percent showRestartButton If true, show restart button showTime If true, show remaining time + showTooltips If true, buttons have tooltips width Width in px self 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