Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transporter now adds a loading spinner to the page - also has styling #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion transporter.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
.infinite-loader {
color: #000;
display: block;
height: 28px;
height: 40px;
text-indent: -9999px;
margin:0 auto;
width:40px;
background-image: url('data:image/gif;base64,R0lGODlhNgA3APMAAP///3h4eBwcHA4ODtjY2FRUVNzc3MTExEhISIqKigAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ7lgQwDcqBnws5DApMHTb93uOosRC8EpA1Bxdnx8wMKl51ckXckFFgFAkamsy0JAppAe1EFqZaAQBAYXXUFU4DWJhZN4ZlAlMSLRW80cSVzM3UgBnksAgYnamwkBm8FjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgOoFIoDe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhLFMBSEWhKC6wqxLLa2W+iiXg8YEtqIIF7vh/QYajaB4XJAuBCHpsTAK0wtCWNiFBAIAqaD0ZUFBXpoknWNCEFvpfURdB8I8noDIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQOrFH1/TbEZt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Im4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAcINQgHlgk8NQmUB6I2nzNSIpynAwgzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwQFNQUESJudxhUEZ9KUz6IFlbTfrpXcPN6UBmcGlgbcBeqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqubCAIAVsGQz3EsijYg5DrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b76IDooY44CsJPDUJfxIHgjZ+P3EWe4gDCItqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBAU1BQSzBGe8UUsiuYIFTpMglSaYIcpfnSHEPMYzyB8GZwZrqSMGxAXath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqubCAIAVsGQz3EsijYg5DrPN8PRLPhfgdEDXHQuGBDQIJXS0Q5B6qtOXsdP0rtADHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcEBTUFBI4WBGw1ApRDT3sTkVQFnGYYaUOYPaVip3MXoDyiP3k3GAaoAgZRnRoGoAW5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOw==');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the use of a base64 encoded GIF here

background-size:40px 40px;
background-position:center center;
background-repeat:no-repeat;
}
#infinite-handle span {
background: #333;
Expand Down
6 changes: 3 additions & 3 deletions transporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Scroller.prototype.refresh = function() {
// Create a loader element to show it's working.
if ( this.click_handle ) {
if( ! $( '.infinite-loader' ).length ){
$( '.site-container' ).append( '<span class="infinite-loader"></span>' );
self.element.append( '<span class="infinite-loader"></span>' );
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main culprit.

}

loader = $( '.infinite-loader' );
Expand All @@ -225,7 +225,7 @@ Scroller.prototype.refresh = function() {
// Allow refreshes to occur again if an error is triggered.
jqxhr.fail( function() {
if ( self.click_handle ) {
loader.hide();
loader.remove();
}

self.ready = true;
Expand All @@ -235,7 +235,7 @@ Scroller.prototype.refresh = function() {
jqxhr.done( function( response ) {
// On success, let's hide the loader circle.
if ( self.click_handle ) {
loader.hide();
loader.remove();
}

// Check for and parse our response.
Expand Down