Revert "Easier closing of dialogs" (introduces regression on date time picker)
This reverts commit 71630aaa77.
This commit is contained in:
@@ -51,7 +51,6 @@
|
|||||||
data-js-lang="<?= $this->app->jsLang() ?>"
|
data-js-lang="<?= $this->app->jsLang() ?>"
|
||||||
data-js-date-format="<?= $this->app->getJsDateFormat() ?>"
|
data-js-date-format="<?= $this->app->getJsDateFormat() ?>"
|
||||||
data-js-time-format="<?= $this->app->getJsTimeFormat() ?>"
|
data-js-time-format="<?= $this->app->getJsTimeFormat() ?>"
|
||||||
data-js-modal-close-msg="<?= t('Close window?\\n\\nChanges that you made have not been saved.') ?>"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<?php if (isset($no_layout) && $no_layout): ?>
|
<?php if (isset($no_layout) && $no_layout): ?>
|
||||||
|
|||||||
4
assets/js/app.min.js
vendored
4
assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@
|
|||||||
var url = KB.dom(baseElement).data('url');
|
var url = KB.dom(baseElement).data('url');
|
||||||
|
|
||||||
if (url) {
|
if (url) {
|
||||||
KB.modal.open(url, 'medium', true);
|
KB.modal.open(url, 'medium', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ KB.keyboardShortcuts = function () {
|
|||||||
|
|
||||||
KB.onKey('?', function () {
|
KB.onKey('?', function () {
|
||||||
if (! KB.modal.isOpen()) {
|
if (! KB.modal.isOpen()) {
|
||||||
KB.modal.open(KB.find('body').data('keyboardShortcutUrl'), '', true);
|
KB.modal.open(KB.find('body').data('keyboardShortcutUrl'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ KB.keyboardShortcuts = function () {
|
|||||||
|
|
||||||
KB.onKey('n', function () {
|
KB.onKey('n', function () {
|
||||||
if (! KB.modal.isOpen()) {
|
if (! KB.modal.isOpen()) {
|
||||||
KB.modal.open(KB.find('#board').data('taskCreationUrl'), 'large', true);
|
KB.modal.open(KB.find('#board').data('taskCreationUrl'), 'large', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -70,25 +70,25 @@ KB.keyboardShortcuts = function () {
|
|||||||
if (KB.exists('#task-view')) {
|
if (KB.exists('#task-view')) {
|
||||||
KB.onKey('e', function () {
|
KB.onKey('e', function () {
|
||||||
if (! KB.modal.isOpen()) {
|
if (! KB.modal.isOpen()) {
|
||||||
KB.modal.open(KB.find('#task-view').data('editUrl'), 'large', true);
|
KB.modal.open(KB.find('#task-view').data('editUrl'), 'large', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
KB.onKey('c', function () {
|
KB.onKey('c', function () {
|
||||||
if (! KB.modal.isOpen()) {
|
if (! KB.modal.isOpen()) {
|
||||||
KB.modal.open(KB.find('#task-view').data('commentUrl'), 'medium', true);
|
KB.modal.open(KB.find('#task-view').data('commentUrl'), 'medium', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
KB.onKey('s', function () {
|
KB.onKey('s', function () {
|
||||||
if (! KB.modal.isOpen()) {
|
if (! KB.modal.isOpen()) {
|
||||||
KB.modal.open(KB.find('#task-view').data('subtaskUrl'), 'medium', true);
|
KB.modal.open(KB.find('#task-view').data('subtaskUrl'), 'medium', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
KB.onKey('l', function () {
|
KB.onKey('l', function () {
|
||||||
if (! KB.modal.isOpen()) {
|
if (! KB.modal.isOpen()) {
|
||||||
KB.modal.open(KB.find('#task-view').data('internalLinkUrl'), 'medium', true);
|
KB.modal.open(KB.find('#task-view').data('internalLinkUrl'), 'medium', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,23 +8,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
KB.onClick('.js-modal-large', function (e) {
|
KB.onClick('.js-modal-large', function (e) {
|
||||||
KB.modal.open(getLink(e), 'large', true);
|
KB.modal.open(getLink(e), 'large', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
KB.onClick('.js-modal-medium', function (e) {
|
KB.onClick('.js-modal-medium', function (e) {
|
||||||
if (KB.modal.isOpen()) {
|
if (KB.modal.isOpen()) {
|
||||||
KB.modal.replace(getLink(e));
|
KB.modal.replace(getLink(e));
|
||||||
} else {
|
} else {
|
||||||
KB.modal.open(getLink(e), 'medium', true);
|
KB.modal.open(getLink(e), 'medium', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
KB.onClick('.js-modal-small', function (e) {
|
KB.onClick('.js-modal-small', function (e) {
|
||||||
KB.modal.open(getLink(e), 'small', true);
|
KB.modal.open(getLink(e), 'small', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
KB.onClick('.js-modal-confirm', function (e) {
|
KB.onClick('.js-modal-confirm', function (e) {
|
||||||
KB.modal.open(getLink(e), 'small', true);
|
KB.modal.open(getLink(e), 'small');
|
||||||
});
|
});
|
||||||
|
|
||||||
KB.onClick('.js-modal-close', function () {
|
KB.onClick('.js-modal-close', function () {
|
||||||
|
|||||||
@@ -1,42 +1,18 @@
|
|||||||
(function () {
|
(function () {
|
||||||
var isOpen = false;
|
var isOpen = false;
|
||||||
var isFormDirty = false;
|
|
||||||
|
|
||||||
function closeIfDirty() {
|
|
||||||
if (isFormDirty == false) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return window.confirm($("body").data("js-modal-close-msg").replace(/\\n/g,"\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function onOverlayClick(e) {
|
function onOverlayClick(e) {
|
||||||
if (e.target.matches('#modal-overlay')) {
|
if (e.target.matches('#modal-overlay')) {
|
||||||
if (closeIfDirty()) {
|
e.stopPropagation();
|
||||||
e.stopPropagation();
|
e.preventDefault();
|
||||||
e.preventDefault();
|
destroy();
|
||||||
destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBeforeUnload(e) {
|
|
||||||
// Cancel the event as stated by the standard.
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
// Chrome requires returnValue to be set.
|
|
||||||
e.returnValue = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function onCloseButtonClick() {
|
function onCloseButtonClick() {
|
||||||
KB.trigger('modal.close');
|
KB.trigger('modal.close');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFormChange() {
|
|
||||||
isFormDirty = true;
|
|
||||||
window.addEventListener('beforeunload', onBeforeUnload, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onFormSubmit() {
|
function onFormSubmit() {
|
||||||
KB.trigger('modal.loading');
|
KB.trigger('modal.loading');
|
||||||
submitForm();
|
submitForm();
|
||||||
@@ -75,7 +51,6 @@
|
|||||||
function afterRendering() {
|
function afterRendering() {
|
||||||
var formElement = KB.find('#modal-content form');
|
var formElement = KB.find('#modal-content form');
|
||||||
if (formElement) {
|
if (formElement) {
|
||||||
formElement.on('change', onFormChange, false);
|
|
||||||
formElement.on('submit', onFormSubmit, false);
|
formElement.on('submit', onFormSubmit, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,13 +65,6 @@
|
|||||||
_KB.tagAutoComplete();
|
_KB.tagAutoComplete();
|
||||||
_KB.get('Task').onPopoverOpened();
|
_KB.get('Task').onPopoverOpened();
|
||||||
|
|
||||||
if (formElement) {
|
|
||||||
$('.form-date').datepicker('option', 'onSelect', onFormChange);
|
|
||||||
$('.form-datetime').datepicker('option', 'onSelect', onFormChange);
|
|
||||||
$(".color-picker").on('change', onFormChange);
|
|
||||||
$(".tag-autocomplete").on('change', onFormChange);
|
|
||||||
}
|
|
||||||
|
|
||||||
KB.trigger('modal.afterRender');
|
KB.trigger('modal.afterRender');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,8 +122,6 @@
|
|||||||
|
|
||||||
function destroy() {
|
function destroy() {
|
||||||
isOpen = false;
|
isOpen = false;
|
||||||
isFormDirty = false;
|
|
||||||
window.removeEventListener('beforeunload', onBeforeUnload, false);
|
|
||||||
var overlayElement = KB.find('#modal-overlay');
|
var overlayElement = KB.find('#modal-overlay');
|
||||||
|
|
||||||
if (overlayElement) {
|
if (overlayElement) {
|
||||||
|
|||||||
4
assets/js/vendor.min.js
vendored
4
assets/js/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user