Revision 78ab8401
Added by Tomer Brisker over 7 years ago
app/assets/javascripts/application.js | ||
---|---|---|
//= require editable/bootstrap-editable
|
||
//= require editable/rails
|
||
|
||
$(document).on('ContentLoad', onContentLoad);
|
||
|
||
$(document).on("page:fetch", tfm.tools.showSpinner)
|
||
|
||
$(document).on("page:change", tfm.tools.hideSpinner)
|
Also available in: Unified diff
Fixes #17570 - Only execute `onContentLoad` once per page
When an event is triggered, jQuery attempts to execute the on<name>
method if it exists for event <name>. We were also manually triggering
the `onContentLoad` every time the `ContentLoad` event was triggered,
leading to the function executing twice on every page.
This commit removes the explicit event listener so that the function
will only execute once.
(cherry picked from commit 83afcbecbdaac702253f494ff07351a74308b6be)