|
@@ -64,7 +64,7 @@
|
|
|
menu
|
|
|
.css({
|
|
|
left: pos[0] + 'px',
|
|
|
- top: pos[1] + 'px',
|
|
|
+ top: (pos[1] + $(window).scrollTop()) + 'px',
|
|
|
})
|
|
|
.show();
|
|
|
|
|
@@ -170,10 +170,6 @@
|
|
|
break;
|
|
|
}
|
|
|
if(consumed) return false;
|
|
|
- })
|
|
|
- .off('selectionchange.shortcuts')
|
|
|
- .on('selectionchange.shortcuts', function(_e) {
|
|
|
- console.log(_e);
|
|
|
});
|
|
|
$(document)
|
|
|
.off('click.apply-shortcuts', '.stag-shortcuts>.sc')
|
|
@@ -208,14 +204,12 @@
|
|
|
showMoeFormMask();
|
|
|
return false;
|
|
|
})
|
|
|
- .off('mousedown.inside-form', '#create-shortcut-form *')
|
|
|
- .on('mousedown.inside-form', '#create-shortcut-form *', function(_e) {
|
|
|
- // return false;
|
|
|
- })
|
|
|
.off('submit.add-shortcut', '#create-shortcut-form')
|
|
|
.on('submit.add-shortcut', '#create-shortcut-form', function(_e) {
|
|
|
+ if(!input) input = $('.note-content [contenteditable]').first();
|
|
|
var label = $(this).find('[name="shortcut"]').val(),
|
|
|
content = $(this).find('[name="text"]').val();
|
|
|
+ if(!this.checkValidity()) return false;
|
|
|
$.post('/api/proTextShortcut/create', $(this).serialize(), function(_data) {
|
|
|
if(_data && _data.success && input) {
|
|
|
var options = [$(input).closest('[data-shortcuts]').attr('data-shortcuts')]
|