add Ox.Progressbar
This commit is contained in:
parent
90e795d194
commit
2a9053a588
4 changed files with 50 additions and 1 deletions
|
@ -69,6 +69,16 @@ Bars
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.OxProgressbar {
|
||||||
|
height: 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
.OxProgressbar > div {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.OxResizebar {
|
.OxResizebar {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
31
source/Ox.UI/js/Bar/Ox.Progressbar.js
Normal file
31
source/Ox.UI/js/Bar/Ox.Progressbar.js
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
Ox.Progressbar = function(options, self) {
|
||||||
|
|
||||||
|
self = self || {};
|
||||||
|
var that = Ox.Element({}, self)
|
||||||
|
.defaults({
|
||||||
|
progress: 0,
|
||||||
|
width: 256
|
||||||
|
})
|
||||||
|
.options(options || {})
|
||||||
|
.addClass('OxProgressbar')
|
||||||
|
.css({width: self.options.width});
|
||||||
|
|
||||||
|
self.$progress = $('<div>').appendTo(that);
|
||||||
|
|
||||||
|
setProgress();
|
||||||
|
|
||||||
|
function setProgress() {
|
||||||
|
self.$progress.css({
|
||||||
|
width: Math.round(16 + self.options.progress * (self.options.width - 16)) + 'px'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
self.setOption = function(key, value) {
|
||||||
|
if (key == 'progress') {
|
||||||
|
setProgress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return that;
|
||||||
|
|
||||||
|
};
|
|
@ -697,7 +697,6 @@ Ox.List = function(options, self) {
|
||||||
offset = page * self.pageLength,
|
offset = page * self.pageLength,
|
||||||
range = [offset, offset + getPageLength(page)];
|
range = [offset, offset + getPageLength(page)];
|
||||||
if (Ox.isUndefined(self.$pages[page])) { // fixme: unload will have made this undefined already
|
if (Ox.isUndefined(self.$pages[page])) { // fixme: unload will have made this undefined already
|
||||||
Ox.print('###################################', self.listLength, getPageLength(0))
|
|
||||||
self.$pages[page] = constructEmptyPage(page);
|
self.$pages[page] = constructEmptyPage(page);
|
||||||
self.options.type == 'text' && page == 0 && fillFirstPage();
|
self.options.type == 'text' && page == 0 && fillFirstPage();
|
||||||
self.$pages[page].appendTo(that.$content);
|
self.$pages[page].appendTo(that.$content);
|
||||||
|
|
|
@ -30,6 +30,15 @@ Bars
|
||||||
background: -webkit-linear-gradient(top, rgb(64, 64, 64), rgb(32, 32, 32));
|
background: -webkit-linear-gradient(top, rgb(64, 64, 64), rgb(32, 32, 32));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.OxThemeModern .OxProgressbar {
|
||||||
|
background: -moz-linear-gradient(top, rgb(0, 0, 0), rgb(32, 32, 32));
|
||||||
|
background: -webkit-linear-gradient(top, rgb(0, 0, 0), rgb(32, 32, 32));
|
||||||
|
}
|
||||||
|
.OxThemeModern .OxProgressbar > div {
|
||||||
|
background: -moz-linear-gradient(top, rgb(96, 96, 96), rgb(64, 64, 64));
|
||||||
|
background: -webkit-linear-gradient(top, rgb(96, 96, 96), rgb(64, 64, 64));
|
||||||
|
}
|
||||||
|
|
||||||
.OxThemeModern .OxResizebar > .OxLine {
|
.OxThemeModern .OxResizebar > .OxLine {
|
||||||
background-color: rgb(48, 48, 48);
|
background-color: rgb(48, 48, 48);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue