Jump to content

Wierd issue - plugin development - repeating page containers


Anthony Musgrove
Go to solution Solved by Luke,

Recommended Posts

Anthony Musgrove

I'm experiencing a very weird issue, where my plugin configuration pages are repeating. 

 

Every time I click on the Scripter-X menu icon, or Actions tab, it just loads a new instance of the Actions configuration page, and leaves the old one in the DOM, just sets it to hidden.

 

Is this normal behaviour or am I missing something?

 

Thank you all!

 

<3

 

5eaae987118f5_pluginspagesrepeating.png

Link to comment
Share on other sites

Anthony Musgrove

The statistics plugin does it too.  Every time you click the menu item, it creates a new instance of the configuration page, and attaches it to the DOM tree, hiding the last one which is exactly the same?

 

5eaaeac262cd3_statisticsplugin.png

Link to comment
Share on other sites

  • Solution

Yes it's normal because each will have it's own state. That's why you need to make sure your code only does dom operations from the page level downwards, and never does anything within the full document scope.

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

And the playback reporting plugin.  I've noticed it only loads 3 instances, is this normal?

 

5eaaeb5131668_playbackreporting.png

Link to comment
Share on other sites

Anthony Musgrove

Yes it's normal because each will have it's own state. That's why you need to make sure your code only does dom operations from the page level downwards, and never does anything within the full document scope.

 

Awesome, thank you mate, I'm glad its normal and not something I've done wrong :)

Link to comment
Share on other sites

Anthony Musgrove

@@Luke, I'm not sure if you can help me -- but I'm trying to include an external javascript library for the plugin, it's a simple library called SortableJS.

 

I've tried many, many, many different ways and I've had a solution that works but not reliably.

 

Is there some type of plugin js function for loading an external JS library?  Or is this not possible?

 

Thanks mate.

Edited by Anthony.Musgrove
Link to comment
Share on other sites

@@Luke, I'm not sure if you can help me -- but I'm trying to include an external javascript library for the plugin, it's a simple library called SortableJS.

 

I've tried many, many, many different ways and I've had a solution that works but not reliably.

 

Is there some type of plugin js function for loading an external JS library?  Or is this not possible?

 

Thanks mate.

 

Yes take a look at the autoorganize plugin.

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Mate, you are worth way way more money.  That worked amazingly.  I'd been working on this for hours.   That function is a godsent.  Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...