Skip to content
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.

Commit

Permalink
Started work on custom progress bars.
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Mar 18, 2018
1 parent b3a1226 commit 7489b4e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions webdows/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,31 @@ var explorer = {
}).after(rep);
}
});
$.each(bod.find('progress'), function() {
if(!$(this).hasClass('progress')) {
oprog = $(this);
nprog = $('<div class="progress"><div></div></div>');
oprog.after(nprog).addClass('progress');
function mutated() {
nprog.attr('style', oprog.attr('style'));
if(oprog.is('[value]')) {
if(oprog.is('[max]')) {
var max = parseFloat(oprog.attr('max'));
} else {
var max = 1;
}
nprog.find('div').attr('style', 'width:'+((parseFloat(oprog.attr('value')) / max) * 100)+'%;');
} else {
//Do animation...
}
}
var obsv = new MutationObserver(mutated);
obsv.observe(oprog[0], {
attributes: true
});
mutated();
}
});
});
});
system.loader('webdows/explorer_ext.js', function() {
Expand Down
19 changes: 18 additions & 1 deletion webdows/resources/explorer/webdows/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ vertical-align: -3px;
::-webkit-scrollbar-button:horizontal:start {
background-image:url('sba4.png');
}
input[type=radio] {
input[type=radio].replaced {
display:none;
}
.input.radio {
Expand Down Expand Up @@ -822,6 +822,23 @@ input[type=radio] {
left:2px;
border-radius:3px;
}
progress.progress {
display:none;
}
.progress {
height:20px;
width:150px;
border:1px solid black;
position:relative;
appearance:none;
}
.progress > div {
height:100%;
position:absolute;
left:0px;
top:0px;
background-color:red;
}
.tabset {
min-width:100px;
min-height:100px;
Expand Down

0 comments on commit 7489b4e

Please sign in to comment.