allow for squared-styled progress bars

This commit is contained in:
rlx 2016-01-12 19:01:15 +05:30
parent 32252a1dfd
commit 1734bcc66f
2 changed files with 12 additions and 1 deletions

View file

@ -233,6 +233,12 @@ Bars
border-radius: 8px; border-radius: 8px;
margin: -1px; margin: -1px;
} }
.OxProgressbar.OxSquared,
.OxProgressbar.OxSquared .OxTrack,
.OxProgressbar.OxSquared .OxProgress {
border-radius: 4px;
}
.OxProgressbar .OxProgress.OxAnimate { .OxProgressbar .OxProgress.OxAnimate {
-webkit-animation: progress 1s linear infinite; -webkit-animation: progress 1s linear infinite;
} }

View file

@ -30,6 +30,7 @@ Ox.Progressbar = function(options, self) {
cancelled: false, cancelled: false,
paused: false, paused: false,
progress: 0, progress: 0,
style: 'default',
showCancelButton: false, showCancelButton: false,
showPauseButton: false, showPauseButton: false,
showPercent: false, showPercent: false,
@ -50,7 +51,11 @@ Ox.Progressbar = function(options, self) {
!self.options.paused && !self.options.cancelled && setProgress(true); !self.options.paused && !self.options.cancelled && setProgress(true);
} }
}) })
.addClass('OxProgressbar') .addClass('OxProgressbar' + (
self.options.style != 'default'
? ' Ox' + Ox.toTitleCase(self.options.style)
: ''
))
.css({width: self.options.width - 2 + 'px'}); .css({width: self.options.width - 2 + 'px'});
self.indeterminate = self.options.progress == -1; self.indeterminate = self.options.progress == -1;