mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Generalize solution to install and register confirmation buttons #1406
This commit is contained in:
parent
bba8bc84a1
commit
3eece44804
@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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?
|
||||
|
||||
@ -194,7 +194,7 @@ define([
|
||||
done: function ($dialog) {
|
||||
$dialog.find('> div').addClass('half');
|
||||
},
|
||||
});
|
||||
}, false, 'btn-confirm');
|
||||
}, 150);
|
||||
};
|
||||
|
||||
|
||||
@ -180,7 +180,7 @@ define([
|
||||
done: function ($dialog) {
|
||||
$dialog.find('> div').addClass('half');
|
||||
},
|
||||
});
|
||||
}, false, 'btn-confirm');
|
||||
}, 150);
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user