@@ -9,6 +9,8 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.buttonMarkup",
9
9
//>>excludeEnd("jqmBuildExclude");
10
10
( function ( $ , undefined ) {
11
11
12
+ var getAttr = $ . mobile . getAttribute ;
13
+
12
14
$ . widget ( "mobile.collapsible" , $ . mobile . widget , {
13
15
options : {
14
16
expandCueText : " click to expand contents" ,
@@ -45,33 +47,33 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
45
47
if ( collapsibleSet . length ) {
46
48
// Inherit the theme from collapsible-set
47
49
if ( ! o . theme ) {
48
- o . theme = collapsibleSet . jqmData ( "theme" ) || $ . mobile . getInheritedTheme ( collapsibleSet , "c" ) ;
50
+ o . theme = getAttr ( collapsibleSet [ 0 ] , "theme" , true ) || $ . mobile . getInheritedTheme ( collapsibleSet , "c" ) ;
49
51
}
50
52
// Inherit the content-theme from collapsible-set
51
53
if ( ! o . contentTheme ) {
52
- o . contentTheme = collapsibleSet . jqmData ( "content-theme" ) ;
54
+ o . contentTheme = getAttr ( collapsibleSet [ 0 ] , "content-theme" , true ) ;
53
55
}
54
56
55
57
// Get the preference for collapsed icon in the set, but override with data- attribute on the individual collapsible
56
- o . collapsedIcon = $el . jqmData ( "collapsed-icon" ) || collapsibleSet . jqmData ( "collapsed-icon" ) || o . collapsedIcon ;
58
+ o . collapsedIcon = getAttr ( $el [ 0 ] , "collapsed-icon" , true ) || getAttr ( collapsibleSet [ 0 ] , "collapsed-icon" , true ) || o . collapsedIcon ;
57
59
58
60
// Get the preference for expanded icon in the set, but override with data- attribute on the individual collapsible
59
- o . expandedIcon = $el . jqmData ( "expanded-icon" ) || collapsibleSet . jqmData ( "expanded-icon" ) || o . expandedIcon ;
61
+ o . expandedIcon = getAttr ( $el [ 0 ] , "expanded-icon" , true ) || getAttr ( collapsibleSet [ 0 ] , "expanded-icon" , true ) || o . expandedIcon ;
60
62
61
63
// Gets the preference icon position in the set, but override with data- attribute on the individual collapsible
62
- o . iconpos = $el . jqmData ( "iconpos" ) || collapsibleSet . jqmData ( "iconpos" ) || o . iconpos ;
64
+ o . iconpos = getAttr ( $el [ 0 ] , "iconpos" , true ) || getAttr ( collapsibleSet [ 0 ] , "iconpos" , true ) || o . iconpos ;
63
65
64
66
// Inherit the preference for inset from collapsible-set or set the default value to ensure equalty within a set
65
- if ( collapsibleSet . jqmData ( "inset" ) !== undefined ) {
66
- o . inset = collapsibleSet . jqmData ( "inset" ) ;
67
+ if ( getAttr ( collapsibleSet [ 0 ] , "inset" , true ) !== undefined ) {
68
+ o . inset = getAttr ( collapsibleSet [ 0 ] , "inset" , true ) ;
67
69
} else {
68
70
o . inset = true ;
69
71
}
70
72
// Set corners for individual collapsibles to false when in a collapsible-set
71
73
o . corners = false ;
72
74
// Gets the preference for mini in the set
73
75
if ( ! o . mini ) {
74
- o . mini = collapsibleSet . jqmData ( "mini" ) ;
76
+ o . mini = getAttr ( collapsibleSet [ 0 ] , "mini" , true ) ;
75
77
}
76
78
} else {
77
79
// get inherited theme if not a set and no theme has been set
0 commit comments