Commit d98e542b authored by bbaer's avatar bbaer
Browse files

#4144: Entwurf, Warnungsfenster mit Reload button webb record gelockt.

parent 8b3d9a02
......@@ -216,11 +216,18 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.dirtyNotifyDenied = function (obj) {
var messageType;
var isModal = false;
var messageButtons = [];
var message;
switch (obj.data.status) {
case "conflict":
messageType = "error";
isModal = true;
messageButtons.push({
label: "Reload",
eventName: 'reload'
});
this.setButtonEnabled(this.getSaveButton(), false);
this.getSaveButton().removeClass(this.getSaveButtonAttentionClass());
this.setButtonEnabled(this.getDeleteButton(), false);
......@@ -250,13 +257,8 @@ var QfqNS = QfqNS || {};
message: obj.data.message,
type: messageType,
timeout: n.Alert.constants.NO_TIMEOUT,
modal: true,
buttons: [
{
label: "Reload",
eventName: 'reload'
}
]
modal: isModal,
buttons: messageButtons
});
message.on('alert.reload', function () {
window.location.reload(true);
......
  • The empty buttons thing isn't life tested, since currently qfq still reports back conflict all the time.

  • How about a Jasmine test? There are a few Jasmine tests already using AJAX mocks, for instance tests/jasmine/unit/spec/DirtySpec.js.

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