-
-
Save glmars/a597f7c28931a38e2e9b3262279889a9 to your computer and use it in GitHub Desktop.
semantic-ui dropdown usage on binding.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
initializing semantic-ui dropdown after creation | |
*/ | |
object SemanticUI { | |
@js.native | |
trait SemanticJQuery extends JQuery { | |
def dropdown(params: js.Any*): SemanticJQuery = js.native | |
} | |
implicit def jq2semantic(jq: JQuery): SemanticJQuery = jq.asInstanceOf[SemanticJQuery] | |
} | |
@dom def simpleDropdownSemantic: Binding[Element] = { | |
val el = <select name="gender" class="ui dropdown" id="simple" data:tabindex="0"> | |
<option value="">Gender</option> | |
<option value="male">Male</option> | |
<option value="female">Female</option> | |
</select> | |
import SemanticUI.jq2semantic | |
JQuery(el).dropdown() | |
el | |
} | |
def main(): Unit = { | |
if(navDebug) println("main ") | |
binding.dom.render(document.body, render) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment