mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
some changes for extension settings
This commit is contained in:
parent
01e688b49e
commit
0029be3291
2 changed files with 28 additions and 3 deletions
|
|
@ -651,7 +651,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
|||
}
|
||||
});
|
||||
|
||||
$("#page_ajax").on('click', 'a[data-ext-settings-action]', function() {
|
||||
$("#page_ajax").on('click', 'a[data-ext-settings-action],button[data-ext-settings-action]', function() {
|
||||
extensionSettingsAction(this.dataset.extSettingsAction, this.dataset.ext);
|
||||
return false;
|
||||
});
|
||||
|
|
@ -2738,7 +2738,7 @@ function showExtensionSettings(ext, callback)
|
|||
{
|
||||
if (_mtt.pages.current && _mtt.pages.current.page == 'ajax' && _mtt.pages.current.pageClass == 'settings') {
|
||||
$('#page_ajax').load(_mtt.apiUrl + 'ext-settings/' + ext, null, function() {
|
||||
if (callback !== undefined) callback();
|
||||
if (callback) callback();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -2785,7 +2785,16 @@ function extensionSettingsAction(actionString, ext)
|
|||
dataType: 'json',
|
||||
success: function(json) {
|
||||
if (json.total && json.total > 0) {
|
||||
showExtensionSettings(ext, json.msg ? function(){flashInfo(json.msg, json.details)} : null);
|
||||
const callback = function() {
|
||||
if (json.msg) flashInfo(json.msg, json.details);
|
||||
if (json.reload) {
|
||||
setTimeout( function(){
|
||||
//window.location.hash = '';
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
showExtensionSettings(ext, callback);
|
||||
}
|
||||
else if (json.msg) {
|
||||
flashInfo(json.msg, json.details);
|
||||
|
|
|
|||
|
|
@ -990,6 +990,7 @@ li.mtt-item-hidden { display:none; }
|
|||
.mtt-settings-table textarea.inmax { height:400px; width:100%; }
|
||||
.mtt-settings-table input,
|
||||
.mtt-settings-table select,
|
||||
.mtt-settings-table button,
|
||||
.mtt-settings-table textarea {
|
||||
padding: 3px;
|
||||
border: 1px solid var(--color-border-default);
|
||||
|
|
@ -1013,6 +1014,21 @@ li.mtt-item-hidden { display:none; }
|
|||
.mtt-settings-table a {
|
||||
color: var(--color-text-default);
|
||||
}
|
||||
.mtt-settings-table button {
|
||||
padding: 3px 6px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.mtt-settings-table .form-bottom-buttons button {
|
||||
min-width: 4rem;
|
||||
padding: 4px 6px;
|
||||
margin: 0 6px;
|
||||
background-color: var(--color-submit);
|
||||
border: 1px solid var(--color-border-default);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.mtt-settings-table .form-bottom-buttons button:hover {
|
||||
background-color: var(--color-submit-hover);
|
||||
}
|
||||
|
||||
#modal {
|
||||
position: fixed;
|
||||
|
|
|
|||
Loading…
Reference in a new issue