Tabslet icon indicating copy to clipboard operation
Tabslet copied to clipboard

Improvements in the js code

Open python2and3developer opened this issue 7 years ago • 0 comments

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;

python2and3developer avatar Jan 18 '18 13:01 python2and3developer