Skip to content

Commit

Permalink
rename cached javascript variable for better namespace isolation
Browse files Browse the repository at this point in the history
  • Loading branch information
tleish authored and excid3 committed Feb 19, 2020
1 parent 2901784 commit a59844f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ function plugin(Vue, options) {
if (this == this.$root && this.$el) {
var destroyEvent = this.$options.turbolinksDestroyEvent || 'turbolinks:visit'
handleVueDestructionOn(destroyEvent, this);
this.$originalEl = this.$el.outerHTML;
this.$turbolinksCachedHTML = this.$el.outerHTML;
// register root hook to restore original element on destroy
this.$once('hook:destroyed', function() {
this.$el.outerHTML = this.$originalEl
this.$el.outerHTML = this.$turbolinksCachedHTML
});
}
},
Expand Down

0 comments on commit a59844f

Please sign in to comment.