Skip to content

Commit 10c00be

Browse files
authored
Merge pull request #470 from wordpress-mobile/issue/fix-broken-html-button
Fix broken HTML button
2 parents c21dfee + f55d327 commit 10c00be

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class MainActivity : AppCompatActivity(),
346346

347347
if (savedInstanceState == null) {
348348
aztec.visualEditor.fromHtml(aztec.sourceEditor?.getPureHtml()!!)
349-
aztec.initHistory()
349+
aztec.initSourceEditorHistory()
350350
}
351351

352352
invalidateOptionsHandler = Handler()
@@ -381,7 +381,7 @@ class MainActivity : AppCompatActivity(),
381381
override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
382382
super.onRestoreInstanceState(savedInstanceState)
383383

384-
aztec.initHistory()
384+
aztec.initSourceEditorHistory()
385385

386386
savedInstanceState?.let {
387387
if (savedInstanceState.getBoolean("isPhotoMediaDialogVisible")) {

aztec/src/main/kotlin/org/wordpress/aztec/Aztec.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ open class Aztec private constructor(val visualEditor: AztecText, val toolbar: A
2626
var sourceEditor: SourceViewEditText? = null
2727

2828
init {
29-
initHistory()
3029
initToolbar()
3130
}
3231

@@ -43,6 +42,9 @@ open class Aztec private constructor(val visualEditor: AztecText, val toolbar: A
4342
private constructor(visualEditor: AztecText, sourceEditor: SourceViewEditText,
4443
toolbar: AztecToolbar, toolbarClickListener: IAztecToolbarClickListener) : this(visualEditor, toolbar, toolbarClickListener) {
4544
this.sourceEditor = sourceEditor
45+
46+
initToolbar()
47+
initSourceEditorHistory()
4648
}
4749

4850
companion object Factory {
@@ -58,6 +60,7 @@ open class Aztec private constructor(val visualEditor: AztecText, val toolbar: A
5860
return Aztec(visualEditor, sourceEditor, toolbar, toolbarClickListener)
5961
}
6062

63+
@JvmStatic
6164
fun with(visualEditor: AztecText, toolbar: AztecToolbar, toolbarClickListener: IAztecToolbarClickListener) : Aztec {
6265
return Aztec(visualEditor, toolbar, toolbarClickListener)
6366
}
@@ -127,7 +130,7 @@ open class Aztec private constructor(val visualEditor: AztecText, val toolbar: A
127130
return this
128131
}
129132

130-
fun initHistory() {
133+
fun initSourceEditorHistory() {
131134
sourceEditor?.history = visualEditor.history
132135
}
133136

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext {
3-
gradlePluginVersion = '3.0.0-beta2'
3+
gradlePluginVersion = '3.0.0-beta3'
44
kotlinVersion = '1.1.4-2'
55
supportLibVersion = '26.0.1'
66
tagSoupVersion = '1.2.1'

0 commit comments

Comments
 (0)