Skip to content
Browse files

Fix destruction of border and border-image renderers so they unset th…

…eir runtimeStyle border styles only when appropriate.
  • Loading branch information...
1 parent 2a6ae13 commit 14b60804d6ecd84c9758a89952822f8108309b92 Jason Johnston committed
Showing with 10 additions and 6 deletions.
  1. +6 −3 sources/BorderImageRenderer.js
  2. +4 −3 sources/BorderRenderer.js
View
9 sources/BorderImageRenderer.js
@@ -146,10 +146,13 @@ PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( {
},
destroy: function() {
- if (!this.finalized && !this.styleInfos.borderInfo.isActive()) {
- var rs = this.targetElement.runtimeStyle;
- rs.borderColor = rs.borderStyle = rs.borderWidth = '';
+ var me = this,
+ rs = me.targetElement.runtimeStyle;
+ rs.borderStyle = rs.borderWidth = '';
+ if (me.finalized || !me.styleInfos.borderInfo.isActive()) {
+ rs.borderColor = '';
}
+ PIE.RendererBase.destroy.call( this );
}
} );
View
7 sources/BorderRenderer.js
@@ -305,10 +305,11 @@ PIE.BorderRenderer = PIE.RendererBase.newRenderer( {
},
destroy: function() {
- PIE.RendererBase.destroy.call( this );
- if (!this.finalized && !this.styleInfos.borderImageInfo.isActive()) {
- this.targetElement.runtimeStyle.borderColor = '';
+ var me = this;
+ if (me.finalized || !me.styleInfos.borderImageInfo.isActive()) {
+ me.targetElement.runtimeStyle.borderColor = '';
}
+ PIE.RendererBase.destroy.call( me );
}

0 comments on commit 14b6080

Please sign in to comment.
Something went wrong with that request. Please try again.