Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
warn about a dumb bug, which I got tripped up myself
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Aug 6, 2017
1 parent 76d50a1 commit 4b43e89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {
}

group 'io.kweb'
version '0.2.10'
version '0.2.11'

apply plugin: 'java'
apply plugin: 'kotlin'
Expand Down Expand Up @@ -111,6 +111,8 @@ configurations.all {
}
}

kotlin { experimental { coroutines 'enable' } }

task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'html'
outputDirectory = javadoc.destinationDir
Expand Down
12 changes: 10 additions & 2 deletions src/main/kotlin/io/kweb/plugins/semanticUI/SemanticUIClasses.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.kweb.plugins.semanticUI

import io.kweb.dom.attributes.AttributeBuilder
import io.kweb.dom.attributes.classes
import io.kweb.dom.attributes.*

class SemanticUIClasses : AttributeBuilder() {

Expand Down Expand Up @@ -495,8 +494,17 @@ class SemanticUIClasses : AttributeBuilder() {
return this
}

private var uiClassAlreadyPresent = false

val ui : SemanticUIClasses get() {
if (uiClassAlreadyPresent) {
throw RuntimeException("""
The .ui getter has already been used on this SematicUIClasses object. Please ensure you are creating a
fresh SemanticUIClasses object (using the 'semantic' getter for every element.
""".trimIndent())
}
classes("ui")
uiClassAlreadyPresent = true
return this
}

Expand Down

0 comments on commit 4b43e89

Please sign in to comment.