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