magr0s / vue-scrollmagic

Vue.js plugin
MIT License
72 stars 24 forks source link

Re-Init Function #20

Open zangab opened 3 years ago

zangab commented 3 years ago

Hi, the problem I (or rather we) face with this plugin is, that there's only 1 controller registered globally. In some views, I just want to get rid of everything meaning to "destroy" that whole thing. However, that breaks everything and scrollmagic stops working because there's only 1 global controller. It would be a nice to add a function like reinit or similar that creates a new controller. Shouldn't be hard.

methods: {
  // that should do it
  reinit() {
     this.controller_ = new Scrollmagic.Controller({ ...options, container: window })
  },
},