Browse Source

Merge branch 'sergi-improve-loading-indicator-208'

master
Igor Zhukov 10 years ago
parent
commit
4f9442e657
  1. 89
      app/css/app.css
  2. 25
      app/js/directives.js
  3. 2
      app/js/lib/mtproto.js

89
app/css/app.css

@ -2706,4 +2706,91 @@ ce671b orange @@ -2706,4 +2706,91 @@ ce671b orange
.modal-content-animated {
-webkit-transition: margin-top linear 0.2s;
transition: margin-top linear 0.2s;
}
}
.loading_dots
{
display: inline-block;
font-size: 1em; /* set size here */
line-height: 1;
padding: 0.125em 0 0.175em 0.15em;
}
.loading_dots span
{
border: 0.15rem solid;
border-radius: 50%;
display: inline-block;
height: 0.2rem;
width: 0.2rem;
margin-left: 0.2rem;
-webkit-animation: loading_dots 0.8s linear infinite;
-moz-animation: loading_dots 0.8s linear infinite;
-ms-animation: loading_dots 0.8s linear infinite;
animation: loading_dots 0.8s linear infinite;
}
.loading_dots span:nth-child(2)
{
-webkit-animation-delay: 0.2s;
-moz-animation-delay: 0.2s;
-ms-animation-delay: 0.2s;
animation-delay: 0.2s;
}
.loading_dots span:nth-child(3)
{
-webkit-animation-delay: 0.4s;
-moz-animation-delay: 0.4s;
-ms-animation-delay: 0.4s;
animation-delay: 0.4s;
}
@-webkit-keyframes loading_dots
{
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@-moz-keyframes loading_dots
{
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@-ms-keyframes loading_dots
{
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes loading_dots
{
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}

25
app/js/directives.js

@ -875,30 +875,9 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -875,30 +875,9 @@ angular.module('myApp.directives', ['myApp.filters'])
link: link,
};
var interval;
function link ($scope, element, attrs) {
var promise = $interval(function () {
var time = tsNow(),
cnt = 3;
if (time % 1000 <= 200) {
cnt = 0;
} else if (time % 1000 <= 400) {
cnt = 1;
} else if (time % 1000 <= 600) {
cnt = 2;
}
var text = '...',
html = text.substr(0, cnt + 1) + (cnt < 2 ? ('<span class="text-invisible">' + text.substr(cnt + 1) + '</span>') : '');
element.html(html);
}, 200);
$scope.$on('$destroy', function cleanup() {
$interval.cancel(promise);
});
element.html('<div class="loading_dots"><span></span>' +
'<span></span><span></span></div>');
}
})

2
app/js/lib/mtproto.js

@ -2712,7 +2712,7 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) { @@ -2712,7 +2712,7 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) {
$window.requestFileSystem = $window.requestFileSystem || $window.webkitRequestFileSystem;
if (!$window.requestFileSystem || true) {
if (!$window.requestFileSystem) {
return cachedFsPromise = $q.reject({type: 'FS_BROWSER_UNSUPPORTED', description: 'requestFileSystem not present'});
}

Loading…
Cancel
Save