@@ -7,40 +7,15 @@ define( [ "jquery.mobile.core" ], function( $ ) {
7
7
//>>excludeEnd("jqmBuildExclude");
8
8
( function ( $ , undefined ) {
9
9
10
- //el can be one of two things:
11
- // 1. [ tagname, { attr: value, ... }, [ children ] ]
12
- // 2. "a string"
13
- var mkEl = function ( el ) {
14
- var ret , key , attr , children , child ;
15
-
16
- if ( $ . type ( el ) === "string" ) {
17
- ret = document . createTextNode ( el ) ;
18
- } else {
19
- ret = document . createElement ( el [ 0 ] ) ;
20
- for ( attr in el [ 1 ] ) {
21
- ret . setAttribute ( attr , el [ 1 ] [ attr ] ) ;
22
- }
23
- children = mkChildren ( el [ 2 ] ) ;
24
- for ( child in children ) {
25
- ret . appendChild ( children [ child ] ) ;
26
- }
27
- }
28
-
29
- return ret ;
30
- } ,
31
-
32
- mkChildren = function ( c ) {
33
- var ret = [ ] , idx ;
34
-
35
- for ( idx in c ) {
36
- ret . push ( mkEl ( c [ idx ] ) ) ;
37
- }
38
-
39
- return ret ;
40
- } ;
41
-
42
- $ . mobile . createDom = mkEl ;
43
- $ . mobile . createDomElements = mkChildren ;
10
+ $ . mobile . makeDom = function ( o ) {
11
+ var prop ,
12
+ ele = document . createElement ( o [ 0 ] ) ;
13
+ for ( prop in o [ 1 ] ) {
14
+ ele . setAttribute ( prop , o [ 1 ] [ prop ] ) ;
15
+ }
16
+ ele . innerHTML = o [ 2 ] ;
17
+ return ele ;
18
+ } ;
44
19
45
20
} ) ( jQuery ) ;
46
21
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
0 commit comments