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 @@ -159,14 +159,22 @@ class PlaceholderManager(
159159 return drawable
160160 }
161161
162- private suspend fun updateAllBelowSelection (selectionStart : Int ) {
163- positionToId.filter {
164- it.elementPosition >= selectionStart - 1
165- }.forEach {
162+ /* *
163+ * Call this method to reload all the placeholders
164+ */
165+ suspend fun reloadAllPlaceholders () {
166+ positionToId.forEach {
166167 insertContentOverSpanWithId(it.uuid)
167168 }
168169 }
169170
171+ /* *
172+ * Call this method to relaod a placeholder with UUID
173+ */
174+ suspend fun refreshWithUuid (uuid : String ) {
175+ insertContentOverSpanWithId(uuid)
176+ }
177+
170178 private suspend fun insertContentOverSpanWithId (uuid : String ) {
171179 var aztecAttributes: AztecAttributes ? = null
172180 val predicate = object : AztecText .AttributePredicate {
@@ -263,7 +271,7 @@ class PlaceholderManager(
263271 */
264272 override fun onContentChanged () {
265273 launch {
266- updateAllBelowSelection(aztecText.selectionStart )
274+ reloadAllPlaceholders( )
267275 }
268276 }
269277
You can’t perform that action at this time.
0 commit comments