Commit 876d5a66 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Added feature as per request in https://project/issues/1966

parent e4984da4
......@@ -733,4 +733,11 @@ var QfqNS = QfqNS || {};
return $('#' + this.formId + ' input[name=s]').val();
};
/**
* @public
*/
n.QfqForm.prototype.isFormChanged = function () {
return this.form.formChanged;
};
})(QfqNS);
\ No newline at end of file
......@@ -53,12 +53,26 @@ var QfqNS = QfqNS || {};
this.settings.fileDeleteUrl);
this.qfqForm.setBsTabs(this.bsTabs);
this.qfqForm.on('qfqform.destroyed', this.destroyFormHandler.bind(this));
window.addEventListener("beforeunload", this.beforeUnloadHandler.bind(this));
} catch (e) {
n.Log.error(e.message);
this.qfqForm = null;
}
};
/**
* @private
*/
n.QfqPage.prototype.beforeUnloadHandler = function (event) {
var message = "\0/";
if (this.qfqForm.isFormChanged()) {
event.returnValue = message;
return message;
}
};
/**
* @private
*/
......
......@@ -793,6 +793,7 @@
</div>
</form>
<a href="www.google.ch">away</a>
</div>
<script src="../js/jquery.min.js"></script>
......@@ -1051,6 +1052,7 @@
});
QfqNS.Log.level = 0;
});
</script>
</body>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment