mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-09 19:26:38 -05:00
Fix an issue where editing markdown on mobile wouldn't enable the submit button, and refresh the editor correctly
This commit is contained in:
parent
45e84497f1
commit
486738d0a7
1 changed files with 8 additions and 5 deletions
13
resources/assets/js/dashboard.js
vendored
13
resources/assets/js/dashboard.js
vendored
|
@ -450,6 +450,11 @@ function editItemInit() {
|
|||
}
|
||||
};
|
||||
|
||||
const contentChanged = function() {
|
||||
changes = true;
|
||||
$submit.removeClass("disabled");
|
||||
};
|
||||
|
||||
$(".edit-button.delete.image").on("click", function(e) {
|
||||
const $this = $(this),
|
||||
name = $this.data("name");
|
||||
|
@ -564,15 +569,13 @@ function editItemInit() {
|
|||
|
||||
setTimeout(function() {
|
||||
simplemde[column].value($this.attr("value"));
|
||||
simplemde[column].refresh();
|
||||
simplemde[column].codemirror.refresh();
|
||||
simplemde[column].codemirror.on("change", contentChanged);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
// initialize change events for back button
|
||||
$editItem.find("input, textarea, select").on("input change", function() {
|
||||
changes = true;
|
||||
$submit.removeClass("disabled");
|
||||
});
|
||||
$editItem.find("input, select").on("input change", contentChanged);
|
||||
|
||||
// initialize back button
|
||||
$backButton.on("click", function() {
|
||||
|
|
Loading…
Reference in a new issue