]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7634
authorsoufiane <soufiane@cubedesigners.com>
Tue, 22 Jul 2025 09:11:14 +0000 (11:11 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 22 Jul 2025 09:11:14 +0000 (11:11 +0200)
resources/markdowneditor/js/markdowneditor.js
resources/markdowneditor/js/markdowneditor.undo.js

index b9cc82f3b876a5130636998b77a89ba202a08a20..a078c92b9159d94a9fa1291746f2e2f8f189aa57 100644 (file)
@@ -31,7 +31,6 @@ MarkdownEditor.prototype = {
         this.initIcons();
         this.markdown();
         this.changePage();
-        this.undo.initState();
 
         $(window).on('hashchange', function () {
             /*if ($this.maskHashEvent) {
@@ -191,6 +190,11 @@ MarkdownEditor.prototype = {
 
         window.location.hash = '#' + this.currentPage;
         $("#markdowneditor-page-field input").val(this.currentPage);
+
+        this.undo.initState();
+        this.undo.updateIconsStates();
+
+        console.log(this.undo.states)
     },
 
     firstPage: function () {
index 0d0767461e2280a3afbc79abd5711d05fcb9dacb..4e0e70f0c91fd8cd2aa6f295d587b8c7d53d42ae 100644 (file)
@@ -56,7 +56,6 @@ MarkdowneditorUndo.prototype = {
         return this._states().undo;
     },
 
-
     pushState: function () {
         if (this.ignoreStatesChanges) {
             console.log('ignore states changes');
@@ -65,9 +64,7 @@ MarkdowneditorUndo.prototype = {
 
         let index = this.indexes[this.markdowneditor.getCurrentPage()];
         if (index === 0) {
-            this.states[this.markdowneditor.getCurrentPage()] = [
-                this.markdowneditor.contentMarkdown
-            ];
+            this.states[this.markdowneditor.getCurrentPage()] = [];
         }
 
         let cs = this.markdowneditor.editor.getMarkdown();