jcubic / jquery.splitter

Plugin that split your content with draggable divider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding and removing additional splitter breaks auto-resize

jhrabows opened this issue · comments

To reproduce:

  1. Create 2 splitters
  2. Remove one of them
  3. Re-size browser window

The result is the following error

Uncaught TypeError: Cannot read property 'refresh' of null on this line:
$.each(splitters, function(i, splitter) {
(=>) splitter.refresh();

The root cause is the way destroy() works: it sets the entry in 'splitters' array to 'null'. But $.each will iterate over nulls as well.

Which version are you using? In 0.16.0 I've replaced null with splitters.splice(id, 1); in destroy method.

Sorry, just noticed that this was fixed in version 16. I was using version 15. Will close.