mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#18937: Adding a confirmation dialog when try to leave navigation with pending changes
Work Item: 18937 --HG-- branch : 1.x
This commit is contained in:
@@ -38,8 +38,19 @@
|
|||||||
// update all positions whenever a menu item was moved
|
// update all positions whenever a menu item was moved
|
||||||
populate(this, '');
|
populate(this, '');
|
||||||
$('#save-message').show();
|
$('#save-message').show();
|
||||||
|
|
||||||
|
// display a message on leave if changes have been made
|
||||||
|
window.onbeforeunload = function (e) {
|
||||||
|
return leaveConfirmation;
|
||||||
|
};
|
||||||
|
|
||||||
|
// cancel leaving message on save
|
||||||
|
$('#saveButton').click(function (e) {
|
||||||
|
window.onbeforeunload = function () { };
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<fieldset class="actions">
|
<fieldset class="actions">
|
||||||
<button type="submit" class="button">@T("Save All")</button>
|
<button id="saveButton" type="submit" class="button">@T("Save All")</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,3 +126,11 @@
|
|||||||
}
|
}
|
||||||
@:</ol>
|
@:</ol>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@using (Script.Foot()) {
|
||||||
|
<script type="text/javascript">
|
||||||
|
//<![CDATA[
|
||||||
|
var leaveConfirmation = '@T("Some items where not saved.")';
|
||||||
|
//]]>
|
||||||
|
</script>
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user