Hi. I am having some issues with TabSwapper. I can add tabs successfully, but once I remove one, I can no longer add any more tabs. There are some errors that occur - see the console when adding/removing tabs. Any insight as to what's going on?
Your indexes are messed up. A zero-indexed array with length x has an index
of zero through (index - 1). You're trying to access the tabs array with an
index that is out of bounds.
Every place where you are trying to access array[array.length], use
array[array.length - 1] and you should be good to go.
Johnny Fuery
President/Principal Engineer
Fuery Solutions -- makers of MerusCase
1736 Franklin Street, Suite 350
Oakland, CA 94612
510.550.5000 Main
925.997.3878 Mobile
510-836-0915 Fax
j...@fuery.com
On Sun, Nov 11, 2012 at 8:37 PM, Philip Thompson <philthath...@gmail.com>wrote:
> Hi. I am having some issues with TabSwapper. I can add tabs successfully,
> but once I remove one, I can no longer add any more tabs. There are some
> errors that occur - see the console when adding/removing tabs. Any insight
> as to what's going on?
> Your indexes are messed up. A zero-indexed array with length x has an index of zero through (index - 1). You're trying to access the tabs array with an index that is out of bounds.
> Every place where you are trying to access array[array.length], use array[array.length - 1] and you should be good to go.
> Johnny Fuery
> President/Principal Engineer
> Fuery Solutions -- makers of MerusCase
> 1736 Franklin Street, Suite 350
> Oakland, CA 94612
> 510.550.5000 Main
> 925.997.3878 Mobile
> 510-836-0915 Fax
> j...@fuery.com
> On Sun, Nov 11, 2012 at 8:37 PM, Philip Thompson <philthath...@gmail.com> wrote:
> Hi. I am having some issues with TabSwapper. I can add tabs successfully, but once I remove one, I can no longer add any more tabs. There are some errors that occur - see the console when adding/removing tabs. Any insight as to what's going on?
> Ok, good catch. Silly me. That explains the removing. But what about the error that's thrown when adding a tab after removing one?
> "TypeError: element is null"
> "var parent = element.parentNode"
> Thanks
> ~Philip
> On Nov 11, 2012, at 10:48 PM, Johnny Fuery <john...@gmail.com> wrote:
>> Your indexes are messed up. A zero-indexed array with length x has an index of zero through (index - 1). You're trying to access the tabs array with an index that is out of bounds.
>> Every place where you are trying to access array[array.length], use array[array.length - 1] and you should be good to go.
>> Johnny Fuery
>> President/Principal Engineer
>> Fuery Solutions -- makers of MerusCase
>> 1736 Franklin Street, Suite 350
>> Oakland, CA 94612
>> 510.550.5000 Main
>> 925.997.3878 Mobile
>> 510-836-0915 Fax
>> j...@fuery.com
>> On Sun, Nov 11, 2012 at 8:37 PM, Philip Thompson <philthath...@gmail.com> wrote:
>> Hi. I am having some issues with TabSwapper. I can add tabs successfully, but once I remove one, I can no longer add any more tabs. There are some errors that occur - see the console when adding/removing tabs. Any insight as to what's going on?
> This *seems* like a bug to me, but I'll let Aaron determine that.
> Thanks,
> ~Philip
> On Nov 11, 2012, at 10:52 PM, Philip Thompson <philthath...@gmail.com>
> wrote:
> Ok, good catch. Silly me. That explains the removing. But what about the
> error that's thrown when adding a tab after removing one?
> "TypeError: element is null"
> "var parent = element.parentNode"
> Thanks
> ~Philip
> On Nov 11, 2012, at 10:48 PM, Johnny Fuery <john...@gmail.com> wrote:
> Your indexes are messed up. A zero-indexed array with length x has an
> index of zero through (index - 1). You're trying to access the tabs array
> with an index that is out of bounds.
> Every place where you are trying to access array[array.length], use
> array[array.length - 1] and you should be good to go.
> Johnny Fuery
> President/Principal Engineer
> Fuery Solutions -- makers of MerusCase
> 1736 Franklin Street, Suite 350
> Oakland, CA 94612
> 510.550.5000 Main
> 925.997.3878 Mobile
> 510-836-0915 Fax
> j...@fuery.com
> On Sun, Nov 11, 2012 at 8:37 PM, Philip Thompson <philthath...@gmail.com>wrote:
>> Hi. I am having some issues with TabSwapper. I can add tabs successfully,
>> but once I remove one, I can no longer add any more tabs. There are some
>> errors that occur - see the console when adding/removing tabs. Any insight
>> as to what's going on?