Skip to content

Commit 23ed5ae

Browse files
committed
Rename HTML toggle method and reverse parameter logic
1 parent 302682d commit 23ed5ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
258258
editor!!.visibility = View.GONE
259259
sourceEditor!!.visibility = View.VISIBLE
260260

261-
toggleHtmlMode(true)
261+
enableFormatToolbar(false)
262262
} else {
263263
toggleButton(findViewById(ToolbarAction.HTML.buttonId), false)
264264
showMediaUploadDialog()
@@ -268,7 +268,7 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
268268
editor!!.visibility = View.VISIBLE
269269
sourceEditor!!.visibility = View.GONE
270270

271-
toggleHtmlMode(false)
271+
enableFormatToolbar(true)
272272
}
273273
}
274274

@@ -312,12 +312,12 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
312312
return null
313313
}
314314

315-
fun toggleHtmlMode(isHtmlMode: Boolean) {
315+
fun enableFormatToolbar(isEnabled: Boolean) {
316316
ToolbarAction.values().forEach { action ->
317317
if (action == ToolbarAction.HTML) {
318-
toggleButton(findViewById(action.buttonId), isHtmlMode)
318+
toggleButton(findViewById(action.buttonId), !isEnabled)
319319
} else {
320-
toggleButtonState(findViewById(action.buttonId), !isHtmlMode)
320+
toggleButtonState(findViewById(action.buttonId), isEnabled)
321321
}
322322
}
323323
}

0 commit comments

Comments
 (0)