mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-28 15:38:17 +00:00
[popup] IE8 does not have someString.filter() so do not use it
This commit is contained in:
parent
3a83863d82
commit
67471757b6
1 changed files with 14 additions and 6 deletions
|
|
@ -57,13 +57,21 @@ $.widget("mobile.popup", $.mobile.widget, {
|
|||
},
|
||||
|
||||
_setTheme: function(dst, theme, unconditional) {
|
||||
var currentTheme = (dst.attr("class") || "")
|
||||
.split(" ")
|
||||
.filter(function(el, idx, ar) {
|
||||
return el.match(/^ui-body-[a-z]$/);
|
||||
});
|
||||
var classes = (dst.attr("class") || "").split(" "),
|
||||
alreadyAdded = true,
|
||||
currentTheme = null,
|
||||
matches;
|
||||
|
||||
currentTheme = ((currentTheme.length > 0) ? currentTheme[0].match(/^ui-body-([a-z])/)[1] : null);
|
||||
while (classes.length > 0) {
|
||||
currentTheme = classes.pop();
|
||||
matches = currentTheme.match(/^ui-body-([a-z])$/);
|
||||
if (matches && matches.length > 1) {
|
||||
currentTheme = matches[1];
|
||||
break;
|
||||
}
|
||||
else
|
||||
currentTheme = null;
|
||||
}
|
||||
|
||||
if (theme !== currentTheme || unconditional) {
|
||||
dst.removeClass("ui-body-" + currentTheme);
|
||||
|
|
|
|||
Loading…
Reference in a new issue