Fixed editor scoll adjustment
This commit is contained in:
parent
7cc1c4e8b7
commit
050dfc21f4
@ -273,8 +273,16 @@ define([
|
||||
}
|
||||
|
||||
var nextTickAdjustScroll = false;
|
||||
var lastSelectionStart, lastSelectionEnd;
|
||||
var saveLastSelection = _.debounce(function() {
|
||||
lastSelectionStart = self.selectionStart;
|
||||
lastSelectionEnd = self.selectionEnd;
|
||||
}, 50);
|
||||
var debouncedSave = utils.debounce(function() {
|
||||
save();
|
||||
if(lastSelectionStart == self.selectionStart && lastSelectionEnd == self.selectionEnd) {
|
||||
nextTickAdjustScroll = false;
|
||||
}
|
||||
self.updateCursorCoordinates(nextTickAdjustScroll);
|
||||
nextTickAdjustScroll = false;
|
||||
});
|
||||
@ -287,6 +295,7 @@ define([
|
||||
else {
|
||||
save();
|
||||
}
|
||||
saveLastSelection();
|
||||
};
|
||||
})();
|
||||
this.getSelectedText = function() {
|
||||
|
@ -4,13 +4,13 @@ define([
|
||||
"utils",
|
||||
"classes/Extension",
|
||||
"text!html/buttonHtmlCode.html",
|
||||
"text!html/buttonHtmlCodeSettingsBlock.html",
|
||||
"text!html/buttonHtmlCodeSettingsBlock.html"
|
||||
], function($, _, utils, Extension, buttonHtmlCodeHTML, buttonHtmlCodeSettingsBlockHTML) {
|
||||
|
||||
var buttonHtmlCode = new Extension("buttonHtmlCode", 'Button "HTML code"', true, true);
|
||||
buttonHtmlCode.settingsBlock = buttonHtmlCodeSettingsBlockHTML;
|
||||
buttonHtmlCode.defaultConfig = {
|
||||
template: "<%= documentHTML %>",
|
||||
template: "<%= documentHTML %>"
|
||||
};
|
||||
|
||||
buttonHtmlCode.onLoadSettings = function() {
|
||||
@ -62,7 +62,7 @@ define([
|
||||
documentHTMLWithFrontMatter: (selectedFileDesc.frontMatter ? selectedFileDesc.frontMatter._frontMatter : '') + htmlWithoutComments,
|
||||
documentHTMLWithComments: htmlWithComments,
|
||||
frontMatter: selectedFileDesc.frontMatter,
|
||||
publishAttributes: undefined,
|
||||
publishAttributes: undefined
|
||||
});
|
||||
textareaElt.value = htmlCode;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ define([
|
||||
eventMgr.onEditorPopover();
|
||||
shown = true;
|
||||
$findReplaceElt.show();
|
||||
$searchForInputElt.focus();
|
||||
$searchForInputElt.focus()[0].setSelectionRange(0, $searchForInputElt.val().length);
|
||||
editor.selectionMgr.adjustTop = 50;
|
||||
editor.selectionMgr.adjustBottom = 220;
|
||||
highlight(true);
|
||||
|
Loading…
Reference in New Issue
Block a user