mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-01 05:30:24 +00:00
Revert "Changed behavior of .jqmData() only when called with no argument. It now returns undefined as per discussion on #jquerymobile-dev"
This reverts commit 43c5037bd8.
This commit is contained in:
parent
43c5037bd8
commit
6dbdbfe4bc
2 changed files with 1 additions and 6 deletions
|
|
@ -150,7 +150,6 @@ $.mobile.loadPage( "searchresults.php", {
|
|||
<dl>
|
||||
<dt><code>·</code> Arguments:</dt>
|
||||
<dd>See jQuery's <a href="http://api.jquery.com/jQuery.data/">data</a> and <a href="http://api.jquery.com/jQuery.removeData/">removeData</a> methods</dd>
|
||||
<strong>Note: </strong>Calling jqmData() with no argument will return <code>undefined</code>. This behavior is subject to change in future versions.
|
||||
<dt><code>·</code> Also:</dt>
|
||||
<dd>When finding elements by their jQuery Mobile data attribute, please use the custom selector <code>:jqmData()</code>, as it automatically incorporates namespaced data attributes into the lookup when they are in use. For example, instead of calling <code>$("div[data-role='page']")</code>, you should use <code>$("div:jqmData(role='page')")</code>, which internally maps to <code>$("div[data-"+ $.mobile.ns +"role='page']")</code> without forcing you to concatenate a namespace into your selectors manually.</dd>
|
||||
</dl>
|
||||
|
|
|
|||
|
|
@ -128,11 +128,7 @@
|
|||
// Mobile version of data and removeData and hasData methods
|
||||
// ensures all data is set and retrieved using jQuery Mobile's data namespace
|
||||
$.fn.jqmData = function( prop, value ) {
|
||||
var result;
|
||||
if ( typeof prop != "undefined" ) {
|
||||
result = this.data( prop ? $.mobile.nsNormalize( prop ) : prop, value );
|
||||
}
|
||||
return result;
|
||||
return this.data( prop ? $.mobile.nsNormalize( prop ) : prop, value );
|
||||
};
|
||||
|
||||
$.jqmData = function( elem, prop, value ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue