File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
media-placeholders/src/main/java/org/wordpress/aztec/placeholders Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,22 @@ class PlaceholderManager(
117117 return drawable
118118 }
119119
120- private suspend fun updateAllBelowSelection (selectionStart : Int ) {
121- positionToId.filter {
122- it.elementPosition >= selectionStart - 1
123- }.forEach {
120+ /* *
121+ * Call this method to reload all the placeholders
122+ */
123+ suspend fun reloadAllPlaceholders () {
124+ positionToId.forEach {
124125 insertContentOverSpanWithId(it.uuid)
125126 }
126127 }
127128
129+ /* *
130+ * Call this method to relaod a placeholder with UUID
131+ */
132+ suspend fun refreshWithUuid (uuid : String ) {
133+ insertContentOverSpanWithId(uuid)
134+ }
135+
128136 private suspend fun insertContentOverSpanWithId (uuid : String ) {
129137 var aztecAttributes: AztecAttributes ? = null
130138 val predicate = object : AztecText .AttributePredicate {
@@ -221,7 +229,7 @@ class PlaceholderManager(
221229 */
222230 override fun onContentChanged () {
223231 launch {
224- updateAllBelowSelection(aztecText.selectionStart )
232+ reloadAllPlaceholders( )
225233 }
226234 }
227235
You can’t perform that action at this time.
0 commit comments