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 @@ -114,14 +114,22 @@ class PlaceholderManager(
114114 return drawable
115115 }
116116
117- private suspend fun updateAllBelowSelection (selectionStart : Int ) {
118- positionToId.filter {
119- it.elementPosition >= selectionStart - 1
120- }.forEach {
117+ /* *
118+ * Call this method to reload all the placeholders
119+ */
120+ suspend fun refresh () {
121+ positionToId.forEach {
121122 insertContentOverSpanWithId(it.uuid)
122123 }
123124 }
124125
126+ /* *
127+ * Call this method to relaod a placeholder with UUID
128+ */
129+ suspend fun refreshWithUuid (uuid : String ) {
130+ insertContentOverSpanWithId(uuid)
131+ }
132+
125133 private suspend fun insertContentOverSpanWithId (uuid : String ) {
126134 var aztecAttributes: AztecAttributes ? = null
127135 val predicate = object : AztecText .AttributePredicate {
@@ -218,7 +226,7 @@ class PlaceholderManager(
218226 */
219227 override fun onContentChanged () {
220228 launch {
221- updateAllBelowSelection(aztecText.selectionStart )
229+ refresh( )
222230 }
223231 }
224232
You can’t perform that action at this time.
0 commit comments