$('#id_revision').unbind().change(function(){
$("#select_revision").click();
});
-
-
});
+
+ function beforeUnload(e) {
+ if($("textarea#editor")[0].value != "") {
+ yourWorkWillBeLost(e);
+ }
+
+ return false;
+ }
+ window.addEventListener('beforeunload', beforeUnload, true);
</script>
{% endblock %}
<div class="title-desc">
{{ form.summary.help_text }}
</div>
- <input type="submit" value="{% trans "Save edit" %}" class="submit" />
+ <input type="submit" value="{% trans "Save edit" %}" class="submit" onclick="window.removeEventListener('beforeunload', beforeUnload, true)" />
<input type="button" value="{% trans "Cancel" %}" class="submit" onclick="history.back(-1);" />
</form>
</div>