diff --git a/bedrock/firefox/templates/firefox/includes/send-to-device.html b/bedrock/firefox/templates/firefox/includes/send-to-device.html index 81a6e209c0..05972d7068 100644 --- a/bedrock/firefox/templates/firefox/includes/send-to-device.html +++ b/bedrock/firefox/templates/firefox/includes/send-to-device.html @@ -4,7 +4,7 @@ file, You can obtain one at https://mozilla.org/MPL/2.0/. #} -
+
{% if include_title %}

diff --git a/media/css/newsletter/newsletter-management.scss b/media/css/newsletter/newsletter-management.scss index 377d7797d5..f512c97d2e 100644 --- a/media/css/newsletter/newsletter-management.scss +++ b/media/css/newsletter/newsletter-management.scss @@ -128,6 +128,8 @@ main { .loading-spinner { display: block; + height: 24px; + background: url('/media/img/icons/loading.svg') no-repeat center; &.hidden { display: none; diff --git a/media/css/protocol/components/send-to-device.scss b/media/css/protocol/components/send-to-device.scss index 26e430ff1f..66f05afda7 100644 --- a/media/css/protocol/components/send-to-device.scss +++ b/media/css/protocol/components/send-to-device.scss @@ -41,6 +41,12 @@ $image-path: '/media/protocol/img'; .more { color: inherit; } + + .loading-spinner { + display: none; + height: 36px; + background: url('/media/img/icons/loading.svg') no-repeat center; + } } // horizontal diff --git a/media/img/icons/loading.svg b/media/img/icons/loading.svg new file mode 100644 index 0000000000..6e3985f6b2 --- /dev/null +++ b/media/img/icons/loading.svg @@ -0,0 +1 @@ + diff --git a/media/js/base/send-to-device.es6.js b/media/js/base/send-to-device.es6.js index 5ccfcf2394..0c7dcaa708 100644 --- a/media/js/base/send-to-device.es6.js +++ b/media/js/base/send-to-device.es6.js @@ -4,7 +4,6 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -import Spinner from '../libs/spin.min'; import FormUtils from '../newsletter/form-utils.es6'; const SendToDevice = function (id) { @@ -27,23 +26,6 @@ const SendToDevice = function (id) { this.spinnerTarget = this.form.querySelector('.loading-spinner'); this.sendAnotherLink = this.form.querySelector('.send-another'); this.formHeading = this.widget.querySelector('.form-heading'); - this.spinnerColor = - this.widget.getAttribute('data-spinner-color') || '#000'; - - this.spinner = new Spinner({ - lines: 12, // The number of lines to draw - length: 4, // The length of each line - width: 2, // The line thickness - radius: 4, // The radius of the inner circle - corners: 0, // Corner roundness (0..1) - rotate: 0, // The rotation offset - direction: 1, // 1: clockwise, -1: counterclockwise - color: this.spinnerColor, // #rgb or #rrggbb or array of colors - speed: 1, // Rounds per second - trail: 60, // Afterglow percentage - shadow: false, // Whether to render a shadow - hwaccel: true // Whether to use hardware acceleration - }); }; /** @@ -116,7 +98,6 @@ SendToDevice.prototype.disableForm = function () { this.input.disabled = true; this.form.classList.add('loading'); this.spinnerTarget.style.display = 'block'; - this.spinner.spin(this.spinnerTarget); }; SendToDevice.prototype.validateFields = function () { diff --git a/media/js/libs/spin.min.js b/media/js/libs/spin.min.js deleted file mode 100644 index fe2ac9352f..0000000000 --- a/media/js/libs/spin.min.js +++ /dev/null @@ -1,2 +0,0 @@ -//fgnass.github.com/spin.js#v2.0.1 -!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k