jquery_mobile_rails 1.4.4.1 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4ecaaf06cb13b4080f8ac037641a9239d59a00b
4
- data.tar.gz: 727c6a2047982b3129ae22476f56a8ef024f917c
3
+ metadata.gz: cf29800abce7a5362e9334e628cdf8eb21ceef34
4
+ data.tar.gz: 7030cb99a8b102200b0db4721ec383a792872305
5
5
  SHA512:
6
- metadata.gz: 0e2379a497ba218caa649975521a503e81dbc0543f83f45c89843e3b30a63596c94c30f74eaee6e0fa50927c07f9721254ba244487af4d733a5d1505d06de9f2
7
- data.tar.gz: 1cbcacadaf2701c29dbba105ef53f9589c4f2611abaa270939da7c468396afa10678d207f8f6e2111c3f62681b5f0fe6540220f0152389225902269d0ca569ea
6
+ metadata.gz: 063ce7d3dd3edb6755f1faaf94efcf5f1063473134fbbfa976df28c20c80d3eaadca5da87f430722e7faf9cd635d8dbbc39875060f5ea6b058b519f5614c5951
7
+ data.tar.gz: 824c432b276d2b7091d197feae27971059135dac00409f638fdcd5c1e374567af765e94fe94168f6d76a98600e61b081fb00e154242cc87ee5bdb84549b4a298
data/README.md CHANGED
@@ -4,7 +4,7 @@ This gem adds the jQuery Mobile files to Rails' asset pipeline.
4
4
 
5
5
  ## Gem's jQuery Mobile Version
6
6
 
7
- 1.4.4 (gem 1.4.4)
7
+ 1.4.5 (gem 1.4.5)
8
8
 
9
9
  ## Installation
10
10
 
@@ -1,3 +1,3 @@
1
1
  module JqueryMobileRails
2
- VERSION = "1.4.4.1"
2
+ VERSION = "1.4.5"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * jQuery Mobile 1.4.4
3
- * Git HEAD hash: b4150fb1c561b614da796c210877fb25e74cf622 <> Date: Fri Sep 12 2014 16:43:26 UTC
2
+ * jQuery Mobile 1.4.5
3
+ * Git HEAD hash: 68e55e78b292634d3991c795f06f5e37a512decc <> Date: Fri Oct 31 2014 17:33:30 UTC
4
4
  * http://jquerymobile.com
5
5
  *
6
6
  * Copyright 2010, 2014 jQuery Foundation, Inc. and othercontributors
@@ -26,204 +26,6 @@
26
26
  $.mobile = {};
27
27
  }( jQuery ));
28
28
 
29
- (function( $, window, undefined ) {
30
- $.extend( $.mobile, {
31
-
32
- // Version of the jQuery Mobile Framework
33
- version: "1.4.4",
34
-
35
- // Deprecated and no longer used in 1.4 remove in 1.5
36
- // Define the url parameter used for referencing widget-generated sub-pages.
37
- // Translates to example.html&ui-page=subpageIdentifier
38
- // hash segment before &ui-page= is used to make Ajax request
39
- subPageUrlKey: "ui-page",
40
-
41
- hideUrlBar: true,
42
-
43
- // Keepnative Selector
44
- keepNative: ":jqmData(role='none'), :jqmData(role='nojs')",
45
-
46
- // Deprecated in 1.4 remove in 1.5
47
- // Class assigned to page currently in view, and during transitions
48
- activePageClass: "ui-page-active",
49
-
50
- // Deprecated in 1.4 remove in 1.5
51
- // Class used for "active" button state, from CSS framework
52
- activeBtnClass: "ui-btn-active",
53
-
54
- // Deprecated in 1.4 remove in 1.5
55
- // Class used for "focus" form element state, from CSS framework
56
- focusClass: "ui-focus",
57
-
58
- // Automatically handle clicks and form submissions through Ajax, when same-domain
59
- ajaxEnabled: true,
60
-
61
- // Automatically load and show pages based on location.hash
62
- hashListeningEnabled: true,
63
-
64
- // disable to prevent jquery from bothering with links
65
- linkBindingEnabled: true,
66
-
67
- // Set default page transition - 'none' for no transitions
68
- defaultPageTransition: "fade",
69
-
70
- // Set maximum window width for transitions to apply - 'false' for no limit
71
- maxTransitionWidth: false,
72
-
73
- // Minimum scroll distance that will be remembered when returning to a page
74
- // Deprecated remove in 1.5
75
- minScrollBack: 0,
76
-
77
- // Set default dialog transition - 'none' for no transitions
78
- defaultDialogTransition: "pop",
79
-
80
- // Error response message - appears when an Ajax page request fails
81
- pageLoadErrorMessage: "Error Loading Page",
82
-
83
- // For error messages, which theme does the box use?
84
- pageLoadErrorMessageTheme: "a",
85
-
86
- // replace calls to window.history.back with phonegaps navigation helper
87
- // where it is provided on the window object
88
- phonegapNavigationEnabled: false,
89
-
90
- //automatically initialize the DOM when it's ready
91
- autoInitializePage: true,
92
-
93
- pushStateEnabled: true,
94
-
95
- // allows users to opt in to ignoring content by marking a parent element as
96
- // data-ignored
97
- ignoreContentEnabled: false,
98
-
99
- buttonMarkup: {
100
- hoverDelay: 200
101
- },
102
-
103
- // disable the alteration of the dynamic base tag or links in the case
104
- // that a dynamic base tag isn't supported
105
- dynamicBaseEnabled: true,
106
-
107
- // default the property to remove dependency on assignment in init module
108
- pageContainer: $(),
109
-
110
- //enable cross-domain page support
111
- allowCrossDomainPages: false,
112
-
113
- dialogHashKey: "&ui-state=dialog"
114
- });
115
- })( jQuery, this );
116
-
117
- (function( $, window, undefined ) {
118
- var nsNormalizeDict = {},
119
- oldFind = $.find,
120
- rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
121
- jqmDataRE = /:jqmData\(([^)]*)\)/g;
122
-
123
- $.extend( $.mobile, {
124
-
125
- // Namespace used framework-wide for data-attrs. Default is no namespace
126
-
127
- ns: "",
128
-
129
- // Retrieve an attribute from an element and perform some massaging of the value
130
-
131
- getAttribute: function( element, key ) {
132
- var data;
133
-
134
- element = element.jquery ? element[0] : element;
135
-
136
- if ( element && element.getAttribute ) {
137
- data = element.getAttribute( "data-" + $.mobile.ns + key );
138
- }
139
-
140
- // Copied from core's src/data.js:dataAttr()
141
- // Convert from a string to a proper data type
142
- try {
143
- data = data === "true" ? true :
144
- data === "false" ? false :
145
- data === "null" ? null :
146
- // Only convert to a number if it doesn't change the string
147
- +data + "" === data ? +data :
148
- rbrace.test( data ) ? JSON.parse( data ) :
149
- data;
150
- } catch( err ) {}
151
-
152
- return data;
153
- },
154
-
155
- // Expose our cache for testing purposes.
156
- nsNormalizeDict: nsNormalizeDict,
157
-
158
- // Take a data attribute property, prepend the namespace
159
- // and then camel case the attribute string. Add the result
160
- // to our nsNormalizeDict so we don't have to do this again.
161
- nsNormalize: function( prop ) {
162
- return nsNormalizeDict[ prop ] ||
163
- ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
164
- },
165
-
166
- // Find the closest javascript page element to gather settings data jsperf test
167
- // http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit
168
- // possibly naive, but it shows that the parsing overhead for *just* the page selector vs
169
- // the page and dialog selector is negligable. This could probably be speed up by
170
- // doing a similar parent node traversal to the one found in the inherited theme code above
171
- closestPageData: function( $target ) {
172
- return $target
173
- .closest( ":jqmData(role='page'), :jqmData(role='dialog')" )
174
- .data( "mobile-page" );
175
- }
176
-
177
- });
178
-
179
- // Mobile version of data and removeData and hasData methods
180
- // ensures all data is set and retrieved using jQuery Mobile's data namespace
181
- $.fn.jqmData = function( prop, value ) {
182
- var result;
183
- if ( typeof prop !== "undefined" ) {
184
- if ( prop ) {
185
- prop = $.mobile.nsNormalize( prop );
186
- }
187
-
188
- // undefined is permitted as an explicit input for the second param
189
- // in this case it returns the value and does not set it to undefined
190
- if ( arguments.length < 2 || value === undefined ) {
191
- result = this.data( prop );
192
- } else {
193
- result = this.data( prop, value );
194
- }
195
- }
196
- return result;
197
- };
198
-
199
- $.jqmData = function( elem, prop, value ) {
200
- var result;
201
- if ( typeof prop !== "undefined" ) {
202
- result = $.data( elem, prop ? $.mobile.nsNormalize( prop ) : prop, value );
203
- }
204
- return result;
205
- };
206
-
207
- $.fn.jqmRemoveData = function( prop ) {
208
- return this.removeData( $.mobile.nsNormalize( prop ) );
209
- };
210
-
211
- $.jqmRemoveData = function( elem, prop ) {
212
- return $.removeData( elem, $.mobile.nsNormalize( prop ) );
213
- };
214
-
215
- $.find = function( selector, context, ret, extra ) {
216
- if ( selector.indexOf( ":jqmData" ) > -1 ) {
217
- selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
218
- }
219
-
220
- return oldFind.call( this, selector, context, ret, extra );
221
- };
222
-
223
- $.extend( $.find, oldFind );
224
-
225
- })( jQuery, this );
226
-
227
29
  /*!
228
30
  * jQuery UI Core c0ab71056b936627e8a7821f03c044aec6280a40
229
31
  * http://jqueryui.com
@@ -521,13 +323,32 @@ $.ui.plugin = {
521
323
  (function( $, window, undefined ) {
522
324
 
523
325
  // Subtract the height of external toolbars from the page height, if the page does not have
524
- // internal toolbars of the same type
326
+ // internal toolbars of the same type. We take care to use the widget options if we find a
327
+ // widget instance and the element's data-attributes otherwise.
525
328
  var compensateToolbars = function( page, desiredHeight ) {
526
329
  var pageParent = page.parent(),
527
330
  toolbarsAffectingHeight = [],
528
- externalHeaders = pageParent.children( ":jqmData(role='header')" ),
331
+
332
+ // We use this function to filter fixed toolbars with option updatePagePadding set to
333
+ // true (which is the default) from our height subtraction, because fixed toolbars with
334
+ // option updatePagePadding set to true compensate for their presence by adding padding
335
+ // to the active page. We want to avoid double-counting by also subtracting their
336
+ // height from the desired page height.
337
+ noPadders = function() {
338
+ var theElement = $( this ),
339
+ widgetOptions = $.mobile.toolbar && theElement.data( "mobile-toolbar" ) ?
340
+ theElement.toolbar( "option" ) : {
341
+ position: theElement.attr( "data-" + $.mobile.ns + "position" ),
342
+ updatePagePadding: ( theElement.attr( "data-" + $.mobile.ns +
343
+ "update-page-padding" ) !== false )
344
+ };
345
+
346
+ return !( widgetOptions.position === "fixed" &&
347
+ widgetOptions.updatePagePadding === true );
348
+ },
349
+ externalHeaders = pageParent.children( ":jqmData(role='header')" ).filter( noPadders ),
529
350
  internalHeaders = page.children( ":jqmData(role='header')" ),
530
- externalFooters = pageParent.children( ":jqmData(role='footer')" ),
351
+ externalFooters = pageParent.children( ":jqmData(role='footer')" ).filter( noPadders ),
531
352
  internalFooters = page.children( ":jqmData(role='footer')" );
532
353
 
533
354
  // If we have no internal headers, but we do have external headers, then their height
@@ -828,6 +649,93 @@ $.ui.plugin = {
828
649
 
829
650
  })( jQuery, this );
830
651
 
652
+ (function( $, window, undefined ) {
653
+ $.extend( $.mobile, {
654
+
655
+ // Version of the jQuery Mobile Framework
656
+ version: "1.4.5",
657
+
658
+ // Deprecated and no longer used in 1.4 remove in 1.5
659
+ // Define the url parameter used for referencing widget-generated sub-pages.
660
+ // Translates to example.html&ui-page=subpageIdentifier
661
+ // hash segment before &ui-page= is used to make Ajax request
662
+ subPageUrlKey: "ui-page",
663
+
664
+ hideUrlBar: true,
665
+
666
+ // Keepnative Selector
667
+ keepNative: ":jqmData(role='none'), :jqmData(role='nojs')",
668
+
669
+ // Deprecated in 1.4 remove in 1.5
670
+ // Class assigned to page currently in view, and during transitions
671
+ activePageClass: "ui-page-active",
672
+
673
+ // Deprecated in 1.4 remove in 1.5
674
+ // Class used for "active" button state, from CSS framework
675
+ activeBtnClass: "ui-btn-active",
676
+
677
+ // Deprecated in 1.4 remove in 1.5
678
+ // Class used for "focus" form element state, from CSS framework
679
+ focusClass: "ui-focus",
680
+
681
+ // Automatically handle clicks and form submissions through Ajax, when same-domain
682
+ ajaxEnabled: true,
683
+
684
+ // Automatically load and show pages based on location.hash
685
+ hashListeningEnabled: true,
686
+
687
+ // disable to prevent jquery from bothering with links
688
+ linkBindingEnabled: true,
689
+
690
+ // Set default page transition - 'none' for no transitions
691
+ defaultPageTransition: "fade",
692
+
693
+ // Set maximum window width for transitions to apply - 'false' for no limit
694
+ maxTransitionWidth: false,
695
+
696
+ // Minimum scroll distance that will be remembered when returning to a page
697
+ // Deprecated remove in 1.5
698
+ minScrollBack: 0,
699
+
700
+ // Set default dialog transition - 'none' for no transitions
701
+ defaultDialogTransition: "pop",
702
+
703
+ // Error response message - appears when an Ajax page request fails
704
+ pageLoadErrorMessage: "Error Loading Page",
705
+
706
+ // For error messages, which theme does the box use?
707
+ pageLoadErrorMessageTheme: "a",
708
+
709
+ // replace calls to window.history.back with phonegaps navigation helper
710
+ // where it is provided on the window object
711
+ phonegapNavigationEnabled: false,
712
+
713
+ //automatically initialize the DOM when it's ready
714
+ autoInitializePage: true,
715
+
716
+ pushStateEnabled: true,
717
+
718
+ // allows users to opt in to ignoring content by marking a parent element as
719
+ // data-ignored
720
+ ignoreContentEnabled: false,
721
+
722
+ buttonMarkup: {
723
+ hoverDelay: 200
724
+ },
725
+
726
+ // disable the alteration of the dynamic base tag or links in the case
727
+ // that a dynamic base tag isn't supported
728
+ dynamicBaseEnabled: true,
729
+
730
+ // default the property to remove dependency on assignment in init module
731
+ pageContainer: $(),
732
+
733
+ //enable cross-domain page support
734
+ allowCrossDomainPages: false,
735
+
736
+ dialogHashKey: "&ui-state=dialog"
737
+ });
738
+ })( jQuery, this );
831
739
 
832
740
  /*!
833
741
  * jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40
@@ -1353,6 +1261,116 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
1353
1261
 
1354
1262
  })( jQuery );
1355
1263
 
1264
+ (function( $, window, undefined ) {
1265
+ var nsNormalizeDict = {},
1266
+ oldFind = $.find,
1267
+ rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
1268
+ jqmDataRE = /:jqmData\(([^)]*)\)/g;
1269
+
1270
+ $.extend( $.mobile, {
1271
+
1272
+ // Namespace used framework-wide for data-attrs. Default is no namespace
1273
+
1274
+ ns: "",
1275
+
1276
+ // Retrieve an attribute from an element and perform some massaging of the value
1277
+
1278
+ getAttribute: function( element, key ) {
1279
+ var data;
1280
+
1281
+ element = element.jquery ? element[0] : element;
1282
+
1283
+ if ( element && element.getAttribute ) {
1284
+ data = element.getAttribute( "data-" + $.mobile.ns + key );
1285
+ }
1286
+
1287
+ // Copied from core's src/data.js:dataAttr()
1288
+ // Convert from a string to a proper data type
1289
+ try {
1290
+ data = data === "true" ? true :
1291
+ data === "false" ? false :
1292
+ data === "null" ? null :
1293
+ // Only convert to a number if it doesn't change the string
1294
+ +data + "" === data ? +data :
1295
+ rbrace.test( data ) ? JSON.parse( data ) :
1296
+ data;
1297
+ } catch( err ) {}
1298
+
1299
+ return data;
1300
+ },
1301
+
1302
+ // Expose our cache for testing purposes.
1303
+ nsNormalizeDict: nsNormalizeDict,
1304
+
1305
+ // Take a data attribute property, prepend the namespace
1306
+ // and then camel case the attribute string. Add the result
1307
+ // to our nsNormalizeDict so we don't have to do this again.
1308
+ nsNormalize: function( prop ) {
1309
+ return nsNormalizeDict[ prop ] ||
1310
+ ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
1311
+ },
1312
+
1313
+ // Find the closest javascript page element to gather settings data jsperf test
1314
+ // http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit
1315
+ // possibly naive, but it shows that the parsing overhead for *just* the page selector vs
1316
+ // the page and dialog selector is negligable. This could probably be speed up by
1317
+ // doing a similar parent node traversal to the one found in the inherited theme code above
1318
+ closestPageData: function( $target ) {
1319
+ return $target
1320
+ .closest( ":jqmData(role='page'), :jqmData(role='dialog')" )
1321
+ .data( "mobile-page" );
1322
+ }
1323
+
1324
+ });
1325
+
1326
+ // Mobile version of data and removeData and hasData methods
1327
+ // ensures all data is set and retrieved using jQuery Mobile's data namespace
1328
+ $.fn.jqmData = function( prop, value ) {
1329
+ var result;
1330
+ if ( typeof prop !== "undefined" ) {
1331
+ if ( prop ) {
1332
+ prop = $.mobile.nsNormalize( prop );
1333
+ }
1334
+
1335
+ // undefined is permitted as an explicit input for the second param
1336
+ // in this case it returns the value and does not set it to undefined
1337
+ if ( arguments.length < 2 || value === undefined ) {
1338
+ result = this.data( prop );
1339
+ } else {
1340
+ result = this.data( prop, value );
1341
+ }
1342
+ }
1343
+ return result;
1344
+ };
1345
+
1346
+ $.jqmData = function( elem, prop, value ) {
1347
+ var result;
1348
+ if ( typeof prop !== "undefined" ) {
1349
+ result = $.data( elem, prop ? $.mobile.nsNormalize( prop ) : prop, value );
1350
+ }
1351
+ return result;
1352
+ };
1353
+
1354
+ $.fn.jqmRemoveData = function( prop ) {
1355
+ return this.removeData( $.mobile.nsNormalize( prop ) );
1356
+ };
1357
+
1358
+ $.jqmRemoveData = function( elem, prop ) {
1359
+ return $.removeData( elem, $.mobile.nsNormalize( prop ) );
1360
+ };
1361
+
1362
+ $.find = function( selector, context, ret, extra ) {
1363
+ if ( selector.indexOf( ":jqmData" ) > -1 ) {
1364
+ selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
1365
+ }
1366
+
1367
+ return oldFind.call( this, selector, context, ret, extra );
1368
+ };
1369
+
1370
+ $.extend( $.find, oldFind );
1371
+
1372
+ })( jQuery, this );
1373
+
1356
1374
  (function( $, undefined ) {
1357
1375
 
1358
1376
  var rcapitals = /[A-Z]/g,
@@ -1495,8 +1513,11 @@ $.mobile.widget = $.Widget;
1495
1513
  this.element.find( "h1" ).text( message );
1496
1514
  }
1497
1515
 
1498
- // attach the loader to the DOM
1499
- this.element.appendTo( $.mobile.pageContainer );
1516
+ // If the pagecontainer widget has been defined we may use the :mobile-pagecontainer
1517
+ // and attach to the element on which the pagecontainer widget has been defined. If not,
1518
+ // we attach to the body.
1519
+ this.element.appendTo( $.mobile.pagecontainer ?
1520
+ $( ":mobile-pagecontainer" ) : $( "body" ) );
1500
1521
 
1501
1522
  // check that the loader is visible
1502
1523
  this.checkLoaderPosition();
@@ -1512,8 +1533,8 @@ $.mobile.widget = $.Widget;
1512
1533
  this.element.removeClass( "ui-loader-fakefix" );
1513
1534
  }
1514
1535
 
1515
- $.mobile.window.unbind( "scroll", this.fakeFixLoader );
1516
- $.mobile.window.unbind( "scroll", this.checkLoaderPosition );
1536
+ this.window.unbind( "scroll", this.fakeFixLoader );
1537
+ this.window.unbind( "scroll", this.checkLoaderPosition );
1517
1538
  }
1518
1539
  });
1519
1540
 
@@ -1911,6 +1932,7 @@ $.mobile.widget = $.Widget;
1911
1932
 
1912
1933
  })(jQuery,this);
1913
1934
 
1935
+
1914
1936
  (function( $, undefined ) {
1915
1937
 
1916
1938
  /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
@@ -5105,8 +5127,16 @@ $.widget( "mobile.page", {
5105
5127
  // know when the content is done loading, or if an error has occurred.
5106
5128
  var deferred = ( options && options.deferred ) || $.Deferred(),
5107
5129
 
5130
+ // Examining the option "reloadPage" passed by the user is deprecated as of 1.4.0
5131
+ // and will be removed in 1.5.0.
5132
+ // Copy option "reloadPage" to "reload", but only if option "reload" is not present
5133
+ reloadOptionExtension =
5134
+ ( ( options && options.reload === undefined &&
5135
+ options.reloadPage !== undefined ) ?
5136
+ { reload: options.reloadPage } : {} ),
5137
+
5108
5138
  // The default load options with overrides specified by the caller.
5109
- settings = $.extend( {}, this._loadDefaults, options ),
5139
+ settings = $.extend( {}, this._loadDefaults, options, reloadOptionExtension ),
5110
5140
 
5111
5141
  // The DOM element for the content after it has been loaded.
5112
5142
  content = null,
@@ -5116,9 +5146,6 @@ $.widget( "mobile.page", {
5116
5146
  absUrl = $.mobile.path.makeUrlAbsolute( url, this._findBaseWithDefault() ),
5117
5147
  fileUrl, dataUrl, pblEvent, triggerData;
5118
5148
 
5119
- // DEPRECATED reloadPage
5120
- settings.reload = settings.reloadPage;
5121
-
5122
5149
  // If the caller provided data, and we're using "get" request,
5123
5150
  // append the data to the URL.
5124
5151
  if ( settings.data && settings.type === "get" ) {
@@ -10062,7 +10089,9 @@ $.widget( "mobile.selectmenu", $.extend( {
10062
10089
  self.refresh();
10063
10090
 
10064
10091
  if ( !!options.nativeMenu ) {
10065
- this.blur();
10092
+ self._delay( function() {
10093
+ self.select.blur();
10094
+ });
10066
10095
  }
10067
10096
  });
10068
10097
 
@@ -10522,12 +10551,10 @@ $.widget( "mobile.popup", {
10522
10551
 
10523
10552
  if ( targetElement !== ui.container[ 0 ] ) {
10524
10553
  target = $( targetElement );
10525
- if ( 0 === target.parents().filter( ui.container[ 0 ] ).length ) {
10526
- $( this.document[ 0 ].activeElement ).one( "focus", function(/* theEvent */) {
10527
- if ( targetElement.nodeName.toLowerCase() !== "body" ) {
10528
- target.blur();
10529
- }
10530
- });
10554
+ if ( !$.contains( ui.container[ 0 ], targetElement ) ) {
10555
+ $( this.document[ 0 ].activeElement ).one( "focus", $.proxy( function() {
10556
+ this._safelyBlur( targetElement );
10557
+ }, this ) );
10531
10558
  ui.focusElement.focus();
10532
10559
  theEvent.preventDefault();
10533
10560
  theEvent.stopImmediatePropagation();
@@ -10858,13 +10885,28 @@ $.widget( "mobile.popup", {
10858
10885
  }
10859
10886
  },
10860
10887
 
10888
+ _safelyBlur: function( currentElement ){
10889
+ if ( currentElement !== this.window[ 0 ] &&
10890
+ currentElement.nodeName.toLowerCase() !== "body" ) {
10891
+ $( currentElement ).blur();
10892
+ }
10893
+ },
10894
+
10861
10895
  _openPrerequisitesComplete: function() {
10862
- var id = this.element.attr( "id" );
10896
+ var id = this.element.attr( "id" ),
10897
+ firstFocus = this._ui.container.find( ":focusable" ).first();
10863
10898
 
10864
10899
  this._ui.container.addClass( "ui-popup-active" );
10865
10900
  this._isOpen = true;
10866
10901
  this._resizeScreen();
10867
- this._ui.container.attr( "tabindex", "0" ).focus();
10902
+
10903
+ // Check to see if currElement is not a child of the container. If it's not, blur
10904
+ if ( !$.contains( this._ui.container[ 0 ], this.document[ 0 ].activeElement ) ) {
10905
+ this._safelyBlur( this.document[ 0 ].activeElement );
10906
+ }
10907
+ if ( firstFocus.length > 0 ) {
10908
+ this._ui.focusElement = firstFocus;
10909
+ }
10868
10910
  this._ignoreResizeEvents();
10869
10911
  if ( id ) {
10870
10912
  this.document.find( "[aria-haspopup='true'][aria-owns='" + id + "']" ).attr( "aria-expanded", true );
@@ -10949,8 +10991,6 @@ $.widget( "mobile.popup", {
10949
10991
  var container = this._ui.container,
10950
10992
  id = this.element.attr( "id" );
10951
10993
 
10952
- container.removeAttr( "tabindex" );
10953
-
10954
10994
  // remove the global mutex for popups
10955
10995
  $.mobile.popup.active = undefined;
10956
10996
 
@@ -11513,9 +11553,8 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
11513
11553
  .find( "a" ).removeClass( $.mobile.activeBtnClass ).end()
11514
11554
  .attr( "aria-selected", false )
11515
11555
  .each(function( i ) {
11516
-
11556
+ var item = $( this );
11517
11557
  if ( $.inArray( i, indices ) > -1 ) {
11518
- var item = $( this );
11519
11558
 
11520
11559
  // Aria selected attr
11521
11560
  item.attr( "aria-selected", true );
@@ -11530,6 +11569,8 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
11530
11569
  item.find( "a" ).addClass( $.mobile.activeBtnClass );
11531
11570
  }
11532
11571
  }
11572
+ } else if ( self.isMultiple ) {
11573
+ item.find( "a" ).removeClass( "ui-checkbox-on" ).addClass( "ui-checkbox-off" );
11533
11574
  }
11534
11575
  });
11535
11576
  },
@@ -12043,16 +12084,22 @@ $.widget( "mobile.controlgroup", $.extend( {
12043
12084
 
12044
12085
  _create: function() {
12045
12086
  var elem = this.element,
12046
- opts = this.options;
12087
+ opts = this.options,
12088
+ keepNative = $.mobile.page.prototype.keepNativeSelector();
12047
12089
 
12048
12090
  // Run buttonmarkup
12049
12091
  if ( $.fn.buttonMarkup ) {
12050
- this.element.find( $.fn.buttonMarkup.initSelector ).buttonMarkup();
12092
+ this.element
12093
+ .find( $.fn.buttonMarkup.initSelector )
12094
+ .not( keepNative )
12095
+ .buttonMarkup();
12051
12096
  }
12052
12097
  // Enhance child widgets
12053
12098
  $.each( this._childWidgets, $.proxy( function( number, widgetName ) {
12054
12099
  if ( $.mobile[ widgetName ] ) {
12055
- this.element.find( $.mobile[ widgetName ].initSelector ).not( $.mobile.page.prototype.keepNativeSelector() )[ widgetName ]();
12100
+ this.element
12101
+ .find( $.mobile[ widgetName ].initSelector )
12102
+ .not( keepNative )[ widgetName ]();
12056
12103
  }
12057
12104
  }, this ));
12058
12105
 
@@ -13268,7 +13315,10 @@ $.widget( "mobile.panel", {
13268
13315
  });
13269
13316
  if ( !this._parentPage && this.options.display !== "overlay" ) {
13270
13317
  this._on( this.document, {
13271
- "pageshow": "_getWrapper"
13318
+ "pageshow": function() {
13319
+ this._openedPage = null;
13320
+ this._getWrapper();
13321
+ }
13272
13322
  });
13273
13323
  }
13274
13324
  // Clean up open panels after page hide