jquery.turbolinks icon indicating copy to clipboard operation
jquery.turbolinks copied to clipboard

Inconsistent behavior

Open romanbsd opened this issue 11 years ago • 0 comments

There's currently inconsistency in the "isReady" / not states. Consider this part of (the compiled javascript):

      if ($.turbo.isReady) {
        return callback($);
      } else {
        return $document.on('turbo:ready', function() {
          return callback($);
        });
      }

When it's ready, then the callback is executed only once (right away), and if it's not, then the callback is added on 'turbo:ready' for ever. I propose to change the "on()" to "one()" for consistency.

P.S. I found that while doing performance analysis of our application, and found multiple invocations of the "onready" callback.

romanbsd avatar Dec 22 '13 14:12 romanbsd