File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed
dom/src/test/scala/com/thoughtworks/binding Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import com.thoughtworks.binding.Binding.Var
4
4
import com .thoughtworks .binding .dom .Runtime .TagsAndTags2
5
5
import org .scalatest .{FreeSpec , Matchers }
6
6
import org .scalajs .dom .html .Div
7
- import scalatags .JsDom
8
7
9
8
/**
10
9
* @author Leonid Turnaev <[email protected] >
@@ -24,25 +23,9 @@ class ComponentModel extends FreeSpec with Matchers {
24
23
}
25
24
26
25
" user defined tag component" in {
27
- import scala .language .implicitConversions
28
-
29
- class Dialog (val div : Div ) {
30
- def caption : String = {
31
- div.getAttribute(" dialog-caption" )
32
- }
33
- def caption_= (caption : String ): Unit = {
34
- div.setAttribute(" dialog-caption" , caption)
35
- }
36
- }
37
-
38
26
object Dialog {
39
- implicit final def toDiv (tag : Dialog ): Div = tag.div
40
-
41
- def render : Dialog = {
42
- val div = JsDom .tags.div.render
43
- div.className = " dialog"
44
- new Dialog (div)
45
- }
27
+ @ dom
28
+ def apply (id : String , caption : Binding [String ]): Binding [Div ] = <div id ={id} class =" dialog" data : dialog-caption ={caption.bind}/>
46
29
}
47
30
48
31
implicit final class UserTags (x : TagsAndTags2 .type ) {
You can’t perform that action at this time.
0 commit comments