Generalize solution to install and register confirmation buttons #1406

This commit is contained in:
DianaXWiki 2024-07-25 23:19:26 +03:00
parent bba8bc84a1
commit 3eece44804
7 changed files with 25 additions and 15 deletions

View File

@ -45,11 +45,14 @@
display: flex;
align-items: center;
justify-content: flex-end;
}
@media screen and (max-width: 600px) {
nav .btn-danger {
line-height: inherit;
@media screen and (max-width: @browser_media-medium-screen) {
.btn-confirm {
line-height: inherit;
overflow-wrap: break-word;
white-space: normal;
width: 100%;
}
}
}

View File

@ -70,11 +70,14 @@
display: flex;
align-items: center;
justify-content: flex-end;
}
@media screen and (max-width: 600px) {
nav .btn-danger {
line-height: inherit;
@media screen and (max-width: @browser_media-medium-screen) {
.btn-confirm {
line-height: inherit;
overflow-wrap: break-word;
white-space: normal;
width: 100%;
}
}
}

View File

@ -775,10 +775,10 @@ define([
});
};
UI.confirm = function (msg, cb, opt, force) {
UI.confirm = function (msg, cb, opt, force, className) {
cb = cb || function () {};
opt = opt || {};
console.log('Parameters:', { msg, cb, opt, force, className });
var message;
if (typeof(msg) === 'string') {
if (!force) { msg = Util.fixHTML(msg); }
@ -791,6 +791,10 @@ define([
var ok = dialog.okButton(opt.ok, opt.okClass);
var cancel = dialog.cancelButton(opt.cancel, opt.cancelClass);
if (className) {
ok.classList.add(className);
}
var frame = dialog.frame([
message,
dialog.nav(opt.reverseOrder?

View File

@ -194,7 +194,7 @@ define([
done: function ($dialog) {
$dialog.find('> div').addClass('half');
},
});
}, false, 'btn-confirm');
}, 150);
};

View File

@ -180,7 +180,7 @@ define([
done: function ($dialog) {
$dialog.find('> div').addClass('half');
},
});
}, false, 'btn-confirm');
}, 150);
};

View File

@ -44,7 +44,7 @@
justify-content: center;
align-items: flex-end;
@media screen and (max-width: @browser_media-medium-screen) {
.btn-danger {
.btn-confirm{
line-height: inherit;
overflow-wrap: break-word;
white-space: normal;

View File

@ -812,7 +812,7 @@ define([
done: function($dialog) {
$dialog.find('> div').addClass('half');
},
});
}, false, 'btn-confirm');
};
$(form).find('button').click(function() {
@ -866,7 +866,7 @@ define([
if (err || obj.error) { return UI.alert(Messages.settings_changePasswordError); }
spinner.done();
});
});
}, null, null, 'cp-button-confirm');
};
$form.find('button').click(function() {