assets/js/romo/spinner.js in romo-0.20.4 vs assets/js/romo/spinner.js in romo-0.20.5

- old
+ new

@@ -42,39 +42,44 @@ this.spinner = new Spinner(spinnerOpts); this.elemHtml = this.elem.innerHTML; this.elemStyle = Romo.attr(this.elem, 'style'); - Romo.setStyle(this.elem, 'position', 'relative'); - Romo.setStyle(this.elem, 'width', Romo.width(this.elem)+'px'); - Romo.setStyle(this.elem, 'height', Romo.height(this.elem)+'px'); + Romo.pushFn(Romo.proxy(function() { + Romo.setStyle(this.elem, 'position', 'relative'); + Romo.setStyle(this.elem, 'width', Romo.width(this.elem)+'px'); + Romo.setStyle(this.elem, 'height', Romo.height(this.elem)+'px'); - Romo.updateHtml(this.elem, ''); - this.spinner.spin(this.elem); + Romo.updateHtml(this.elem, ''); + this.spinner.spin(this.elem); - Romo.trigger(this.elem, 'romoSpinner:start', [this]); + Romo.trigger(this.elem, 'romoSpinner:start', [this]); + }, this)); } RomoSpinner.prototype.doStop = function() { if (this.spinner === undefined) { return; } - if (this.spinner !== undefined) { + Romo.pushFn(Romo.proxy(function() { this.spinner.stop(); this.spinner = undefined; - } - if (this.elemHtml !== undefined) { - this.elem.innerHTML = this.elemHtml; - } - Romo.rmStyle(this.elem, 'position'); - Romo.rmStyle(this.elem, 'width'); - Romo.rmStyle(this.elem, 'height'); - if (this.elemStyle !== undefined) { - Romo.setAttr(this.elem, 'style', this.elemStyle); - } - Romo.trigger(this.elem, 'romoSpinner:stop', [this]); + if (this.elemHtml !== undefined) { + this.elem.innerHTML = this.elemHtml; + } + + Romo.rmStyle(this.elem, 'position'); + Romo.rmStyle(this.elem, 'width'); + Romo.rmStyle(this.elem, 'height'); + + if (this.elemStyle !== undefined) { + Romo.setAttr(this.elem, 'style', this.elemStyle); + } + + Romo.trigger(this.elem, 'romoSpinner:stop', [this]); + }, this)) } // private RomoSpinner.prototype._bindElem = function() {