mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-03 13:41:12 +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
|
||||
|
@ -36,8 +42,8 @@ var TinyMCE = (function() {
|
|||
var lastDraftTime = parseInt(tinyMCE.util.LocalStorage.getItem(prefix + 'time'), 10);
|
||||
var lastUpdated = $(selector).data('last-updated');
|
||||
|
||||
var restoreBtn = $('<button type="button" class="btn pull-right">Restore Draft</button>');
|
||||
var cancelBtn = $('<div class="tinymce-cancel-button pull-right">' +
|
||||
var restoreBtn = $('<button class="btn restore-draft-btn pull-right">Restore Draft</button>');
|
||||
var cancelBtn = $('<div class="tinymce-cancel-notification-button pull-right">' +
|
||||
'<button type="button">' +
|
||||
'<span class="fas fa-times"></span>' +
|
||||
'</button></div>');
|
||||
|
@ -60,6 +66,7 @@ var TinyMCE = (function() {
|
|||
$(restoreBtn).click(function() {
|
||||
editor.plugins.autosave.restoreDraft();
|
||||
editor.plugins.autosave.removeDraft();
|
||||
refreshSaveButton(editor);
|
||||
notificationBar.remove();
|
||||
});
|
||||
|
||||
|
@ -281,10 +288,7 @@ var TinyMCE = (function() {
|
|||
});
|
||||
|
||||
editor.on('Dirty', function() {
|
||||
var editorForm = $(editor.getContainer()).closest('form');
|
||||
editorForm.find('.tinymce-status-badge').addClass('hidden');
|
||||
$(editor.getContainer())
|
||||
.find('.tinymce-save-button').removeClass('hidden');
|
||||
refreshSaveButton(editor);
|
||||
});
|
||||
|
||||
editor.on('remove', function() {
|
||||
|
|
|
@ -67,12 +67,31 @@
|
|||
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 {
|
||||
background: $state-info-bg !important;
|
||||
height: 25px !important;
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !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
|
||||
|
|
Loading…
Reference in a new issue