mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 02:43:44 +08:00
Merge pull request #2223 from velesin/about_me_editor_fix
FIX: broken Pagedown editor for About, Site Content and similar places.
This commit is contained in:
commit
858eb5ed9a
|
@ -871,10 +871,13 @@
|
||||||
|
|
||||||
var prevScrollPosition = $(panels.input).scrollTop();
|
var prevScrollPosition = $(panels.input).scrollTop();
|
||||||
var caretMarkerPosition = 0;
|
var caretMarkerPosition = 0;
|
||||||
var markerPositions = {
|
var markerPositions;
|
||||||
|
if (panels.previewScroller) {
|
||||||
|
markerPositions = {
|
||||||
scroller: [0, paneContentHeight(panels.previewScroller)],
|
scroller: [0, paneContentHeight(panels.previewScroller)],
|
||||||
preview: [0, paneContentHeight(panels.preview)]
|
preview: [0, paneContentHeight(panels.preview)]
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var getCaretPosition = function() {
|
var getCaretPosition = function() {
|
||||||
return Discourse.Utilities.caretPosition(panels.input);
|
return Discourse.Utilities.caretPosition(panels.input);
|
||||||
|
@ -1040,9 +1043,11 @@
|
||||||
|
|
||||||
Ember.run(function() {
|
Ember.run(function() {
|
||||||
pushPreviewHtml(previewText, previewScrollerText);
|
pushPreviewHtml(previewText, previewScrollerText);
|
||||||
|
if (panels.previewScroller) {
|
||||||
cacheMarkerPositions();
|
cacheMarkerPositions();
|
||||||
cacheCaretMarkerPosition();
|
cacheCaretMarkerPosition();
|
||||||
syncScroll(true);
|
syncScroll(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1149,13 +1154,17 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
ieSafeSet(panels.preview, previewText);
|
ieSafeSet(panels.preview, previewText);
|
||||||
|
if (panels.previewScroller) {
|
||||||
ieSafeSet(panels.previewScroller, previewScrollerText);
|
ieSafeSet(panels.previewScroller, previewScrollerText);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var nonSuckyBrowserPreviewSet = function (previewText, previewScrollerText) {
|
var nonSuckyBrowserPreviewSet = function (previewText, previewScrollerText) {
|
||||||
panels.preview.innerHTML = previewText;
|
panels.preview.innerHTML = previewText;
|
||||||
|
if (panels.previewScroller) {
|
||||||
panels.previewScroller.innerHTML = previewScrollerText;
|
panels.previewScroller.innerHTML = previewScrollerText;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var previewSetter;
|
var previewSetter;
|
||||||
|
|
||||||
|
@ -1204,7 +1213,9 @@
|
||||||
// TODO: make option to disable. We don't need this in discourse
|
// TODO: make option to disable. We don't need this in discourse
|
||||||
// setupEvents(panels.input, applyTimeout);
|
// setupEvents(panels.input, applyTimeout);
|
||||||
|
|
||||||
|
if (panels.previewScroller) {
|
||||||
setupScrollSync();
|
setupScrollSync();
|
||||||
|
}
|
||||||
|
|
||||||
makePreviewHtml();
|
makePreviewHtml();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user