mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-25 08:34:43 +00:00
added commentary on selector perf and whitespace
This commit is contained in:
parent
a80e4c3b4c
commit
c49eac6e67
1 changed files with 9 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* "core" - The base file for jQm
|
||||
*/
|
||||
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
}
|
||||
e = e.parentNode;
|
||||
}
|
||||
|
||||
|
||||
// Return the theme letter we found, if none, return the
|
||||
// specified default.
|
||||
|
||||
|
|
@ -160,11 +160,13 @@
|
|||
}
|
||||
});
|
||||
|
||||
// TODO the following $ and $.fn extensions can/probably should be moved into
|
||||
// jquery.mobile.core.helpers
|
||||
|
||||
// Find the closest javascript page element to gather settings data
|
||||
// TODO complex selector parsing will slow down page load times
|
||||
// TODO the following $ and $.fn extensions can/probably should be moved into jquery.mobile.core.helpers
|
||||
//
|
||||
// Find the closest javascript page element to gather settings data jsperf test
|
||||
// http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit
|
||||
// possibly naive, but it shows that the parsing overhead for *just* the page selector vs
|
||||
// the page and dialog selector is negligable. This could probably be speed up by
|
||||
// doing a similar parent node traversal to the one found in the inherited theme code above
|
||||
$.fn.closestPageData = function() {
|
||||
return $(this)
|
||||
.closest(':jqmData(role="page"), :jqmData(role="dialog")')
|
||||
|
|
|
|||
Loading…
Reference in a new issue