Tabslet
Tabslet copied to clipboard
Improvements in the js code
I made these improvements:
- Inside the function
forward
. The event handler for mouseover is only attached if$this.opts.pauseonhover
is true. Before the handler is attached anyway and the condition was checked inside the handler.
if ($this.opts.pauseonhover) {
$this.mouseover(function () {
clearTimeout(t);
});
}
- The block of the
if
condition:
if (! $this.data( 'tabslet-init' ) ) {
...
}
is very big. The function returns early if the tabselt-init data attribute was set.
if ( $this.data( 'tabslet-init' ) ) return;