moved cancelbutton to timelines modals.

pull/232/head
Nils Kenneweg 11 years ago
parent 3946a0239f
commit b3912dfe07
  1. 9
      app/assets/javascripts/modal.js
  2. 11
      app/assets/javascripts/timelines_modal.js

@ -144,15 +144,6 @@ var ModalHelper = (function() {
}
});
// close when cancel is clicked.
ta.find('[name=cancelButton]').click(function(e) {
e.preventDefault();
if (ta.data('changed') !== true || confirm(I18n.t('js.timelines.really_close_dialog'))) {
ta.data('changed', false);
ta.dialog('close');
}
});
// hide dialog header
//TODO: we need a default close button somewhere
ta.parent().prepend('<div id="ui-dialog-closer" />');

@ -80,6 +80,7 @@ ModalHelper.prototype.createPlanningModal = function(type, projectId, elementId,
}
} else if (err !== '500') {
ele.find('.errorExplanation').remove();
var error = jQuery('<div>').attr('class', 'errorExplanation').attr('id', 'errorExplanation');
var json = jQuery.parseJSON(res);
var i, errorSpan, errorFormEle;
@ -109,6 +110,16 @@ ModalHelper.prototype.createPlanningModal = function(type, projectId, elementId,
e.preventDefault();
}
};
// close when cancel is clicked.
ele.find('[name=cancelButton]').click(function(e) {
e.preventDefault();
if (ele.data('changed') !== true || confirm(I18n.t('js.timelines.really_close_dialog'))) {
ele.data('changed', false);
ele.dialog('close');
}
});
//if we want to create a new element, the project must be selectable.
if (type === 'new') {
ele.find('tbody').first().prepend(

Loading…
Cancel
Save