Skip to content

Commit

Permalink
Fixed MainProgress, added position bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
PatchwerkQWER committed Sep 6, 2020
1 parent 35bba1d commit cde1ba2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions j-MainProgress/component.css
@@ -1 +1,2 @@
.ui-mainprogress { position: fixed; left: 0; top: 0; height: 2px; z-index: 1000; background-color: #4285F4; box-shadow: 0 2px 10px rgba(66,130,244,0.8); }
.ui-mainprogress-bottom { bottom: 0; top: unset; box-shadow: 0 -2px 10px rgba(66,130,244,0.8); }
7 changes: 4 additions & 3 deletions j-MainProgress/component.js
@@ -1,4 +1,4 @@
COMPONENT('mainprogress', function(self, cls) {
COMPONENT('mainprogress', function(self, config, cls) {

var old = null;

Expand All @@ -7,7 +7,8 @@ COMPONENT('mainprogress', function(self, cls) {
self.nocompile();

self.make = function() {
self.aclass(cls + ' hidden');
var temp = config.position === 'bottom' ? ' ' + cls + '-bottom' : '';
self.aclass(cls + temp + ' hidden');
};

self.setter = function(value) {
Expand All @@ -26,4 +27,4 @@ COMPONENT('mainprogress', function(self, cls) {
self.element.stop().animate({ width: old + '%' }, 80).show();
self.tclass('hidden', old === 0 || old === 100);
};
});
});
4 changes: 2 additions & 2 deletions j-MainProgress/component.json
@@ -1,6 +1,6 @@
{
"datecreated": "2017-10-31T10:57:00.000Z",
"dateupdated": null,
"dateupdated": "2020-09-06T23:25:00.000Z",
"name": "j-MainProgress",
"tags": [
"jcomponent"
Expand All @@ -13,4 +13,4 @@
"author": "Peter Širka",
"email": "petersirka@gmail.com",
"license": "https://www.totaljs.com/license/"
}
}
4 changes: 2 additions & 2 deletions j-MainProgress/dependencies.html
@@ -1,2 +1,2 @@
<link href="https://cdn.componentator.com/spa.min@17.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.componentator.com/spa.min@17.js"></script>
<link href="https://cdn.componentator.com/spa.min@18.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.componentator.com/spa.min@18.js"></script>
4 changes: 2 additions & 2 deletions j-MainProgress/example.html
@@ -1,8 +1,8 @@
<div data-jc="mainprogress__percentage"></div>
<div data---="mainprogress__percentage"></div>

<script>
var percentage = 30;
setInterval(function() {
SET('percentage', (Math.random() * 100) >> 0);
}, 800);
</script>
</script>
5 changes: 4 additions & 1 deletion j-MainProgress/readme.md
Expand Up @@ -2,8 +2,11 @@

This component is singleton. The component is visible when the value if more than `0` and less than `100`. Data-binding expects `Number`.

__Configuration__:

- `position` {String} optional, can be `bottom` (default: `top`)

### Author

- Peter Širka <petersirka@gmail.com>
- [License](https://www.totaljs.com/license/)

0 comments on commit cde1ba2

Please sign in to comment.