-
-
Notifications
You must be signed in to change notification settings - Fork 18
Update page properly when changing custom cover image metadata (BL-16100) #7823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1098,9 +1098,26 @@ public void UpdateMetaData(string url) | |||||||||||||||||||||||||||||||||||||||
| imgElt, | ||||||||||||||||||||||||||||||||||||||||
| new NullProgress() | ||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||
| if (_nextSaveMustBeFull) | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| // We've changed the metadata on the current page, but a full save will | ||||||||||||||||||||||||||||||||||||||||
| // try to sync everything using the data-div, which has not yet been updated. | ||||||||||||||||||||||||||||||||||||||||
| // It comes before the page, so the out-of-date copy there will overwrite the | ||||||||||||||||||||||||||||||||||||||||
| // changes we just made. The simplest way to prevent this is to update the | ||||||||||||||||||||||||||||||||||||||||
| // data-div to match the current page before we do the full save. | ||||||||||||||||||||||||||||||||||||||||
| UpdateDataDivFromCurrentPage(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| RefreshDisplayOfCurrentPage(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| private void UpdateDataDivFromCurrentPage() | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| CurrentBook.BookData.SuckInDataFromEditedDom( | ||||||||||||||||||||||||||||||||||||||||
| _pageSelection.CurrentSelection.GetDivNodeForThisPage(), | ||||||||||||||||||||||||||||||||||||||||
| CurrentBook.BookInfo | ||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1113
to
+1119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Missing comment on private method UpdateDataDivFromCurrentPage The new private method
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| private DataSet _pageDataBeforeEdits; | ||||||||||||||||||||||||||||||||||||||||
| private string _featureRequirementsBeforeEdits; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1349,6 +1366,7 @@ private static void OptimizeForLinux(HtmlDom pageListDom) | |||||||||||||||||||||||||||||||||||||||
| "img { image-rendering: optimizeSpeed; image-rendering: crisp-edges; }"; | ||||||||||||||||||||||||||||||||||||||||
| pageListDom.RawDom.GetElementsByTagName("head")[0].AppendChild(style); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| internal void SaveToolboxSettings(string data) | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| // ref BL-9859, BL-9912, BL-9978 | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 UpdateDataDivFromCurrentPage only runs when _nextSaveMustBeFull — metadata updates on non-full-save pages may not sync to data-div
The new guard at
src/BloomExe/Edit/EditingModel.cs:1101only callsUpdateDataDivFromCurrentPagewhen_nextSaveMustBeFullis true. When it's false (quick save), the image metadata updated byUpdateImgMetadataAttributesToMatchImageon the master DOM page won't be synced to the data-div. For non-custom-layout pages this is fine (image metadata isn't stored in the data-div). But for custom layout pages where the entire margin box is stored in the data-div, a quick save could leave the data-div with stale metadata. This may be acceptable if custom layout pages always trigger a full save, but it's worth confirming thatNeedToDoFullSave/_nextSaveMustBeFullis always true for custom layout pages when metadata changes.Was this helpful? React with 👍 or 👎 to provide feedback.