mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added onbeforeunload check to unsaved changes warning feature
This commit is contained in:
parent
bdd2c9d033
commit
a1d5e26f6b
@ -16,6 +16,12 @@ function (angular, _, config) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var modalScope = $rootScope.$new();
|
var modalScope = $rootScope.$new();
|
||||||
|
|
||||||
|
window.onbeforeunload = function () {
|
||||||
|
if (self.has_unsaved_changes()) {
|
||||||
|
return "There are unsaved changes to this dashboard";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.init = function() {
|
this.init = function() {
|
||||||
$rootScope.$on("$locationChangeStart", function(event, next) {
|
$rootScope.$on("$locationChangeStart", function(event, next) {
|
||||||
if (self.has_unsaved_changes()) {
|
if (self.has_unsaved_changes()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user