mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-02 01:45:38 +08:00
Fix styles for notification bar
This commit is contained in:
parent
4f2182e2f5
commit
b286e4adfd
2 changed files with 29 additions and 6 deletions
16
app/assets/javascripts/sitewide/tiny_mce.js
vendored
16
app/assets/javascripts/sitewide/tiny_mce.js
vendored
|
@ -16,6 +16,12 @@ var TinyMCE = (function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function refreshSaveButton(editor) {
|
||||||
|
var editorForm = $(editor.getContainer()).closest('form');
|
||||||
|
editorForm.find('.tinymce-status-badge').addClass('hidden');
|
||||||
|
$(editor.getContainer())
|
||||||
|
.find('.tinymce-save-button').removeClass('hidden');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get LocalStorage auto save path
|
// Get LocalStorage auto save path
|
||||||
|
@ -36,8 +42,8 @@ var TinyMCE = (function() {
|
||||||
var lastDraftTime = parseInt(tinyMCE.util.LocalStorage.getItem(prefix + 'time'), 10);
|
var lastDraftTime = parseInt(tinyMCE.util.LocalStorage.getItem(prefix + 'time'), 10);
|
||||||
var lastUpdated = $(selector).data('last-updated');
|
var lastUpdated = $(selector).data('last-updated');
|
||||||
|
|
||||||
var restoreBtn = $('<button type="button" class="btn pull-right">Restore Draft</button>');
|
var restoreBtn = $('<button class="btn restore-draft-btn pull-right">Restore Draft</button>');
|
||||||
var cancelBtn = $('<div class="tinymce-cancel-button pull-right">' +
|
var cancelBtn = $('<div class="tinymce-cancel-notification-button pull-right">' +
|
||||||
'<button type="button">' +
|
'<button type="button">' +
|
||||||
'<span class="fas fa-times"></span>' +
|
'<span class="fas fa-times"></span>' +
|
||||||
'</button></div>');
|
'</button></div>');
|
||||||
|
@ -60,6 +66,7 @@ var TinyMCE = (function() {
|
||||||
$(restoreBtn).click(function() {
|
$(restoreBtn).click(function() {
|
||||||
editor.plugins.autosave.restoreDraft();
|
editor.plugins.autosave.restoreDraft();
|
||||||
editor.plugins.autosave.removeDraft();
|
editor.plugins.autosave.removeDraft();
|
||||||
|
refreshSaveButton(editor);
|
||||||
notificationBar.remove();
|
notificationBar.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -281,10 +288,7 @@ var TinyMCE = (function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on('Dirty', function() {
|
editor.on('Dirty', function() {
|
||||||
var editorForm = $(editor.getContainer()).closest('form');
|
refreshSaveButton(editor);
|
||||||
editorForm.find('.tinymce-status-badge').addClass('hidden');
|
|
||||||
$(editor.getContainer())
|
|
||||||
.find('.tinymce-save-button').removeClass('hidden');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on('remove', function() {
|
editor.on('remove', function() {
|
||||||
|
|
|
@ -67,12 +67,31 @@
|
||||||
background: $color-white !important;
|
background: $color-white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tinymce-cancel-notification-button {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.fas {
|
||||||
|
color: $color-silver-chalice;
|
||||||
|
font-family: 'Font Awesome 5 Free';
|
||||||
|
font-weight: 501;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.restore-draft-notification {
|
.restore-draft-notification {
|
||||||
background: $state-info-bg !important;
|
background: $state-info-bg !important;
|
||||||
height: 25px !important;
|
height: 25px !important;
|
||||||
padding-left: 10px !important;
|
padding-left: 10px !important;
|
||||||
padding-right: 10px !important;
|
padding-right: 10px !important;
|
||||||
padding-top: 5px !important;
|
padding-top: 5px !important;
|
||||||
|
|
||||||
|
.restore-draft-btn {
|
||||||
|
border: 1px solid $color-silver-chalice;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-top: -2px;
|
||||||
|
padding: 3px 10px 3px 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// scss-lint:enable ImportantRule
|
// scss-lint:enable ImportantRule
|
||||||
|
|
Loading…
Add table
Reference in a new issue