0002-js-launch-autosave-on-tab-change-58276.patch
wcs/qommon/static/js/qommon.forms.js | ||
---|---|---|
165 | 165 |
} |
166 | 166 |
}); |
167 | 167 | |
168 |
$(window).on('pagehide', function () { |
|
169 |
if (autosave_timeout_id !== null && ! $('body').hasClass('autosaving')) { |
|
170 |
window.clearTimeout(autosave_timeout_id); |
|
171 |
autosave(); |
|
172 |
} |
|
173 |
}); |
|
174 | ||
175 |
$(document).on('visibilitychange', function () { |
|
176 |
if (document.visibilityState == 'hidden' && autosave_timeout_id !== null && ! $('body').hasClass('autosaving')) { |
|
177 |
window.clearTimeout(autosave_timeout_id); |
|
178 |
autosave(); |
|
179 |
} |
|
180 |
}); |
|
181 | ||
168 | 182 |
install_autosave(); |
169 | 183 | |
170 | 184 |
$('#tracking-code a').on('click', autosave); |
171 |
- |