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