Permalink
Browse files

Use $.inArray instead of indexOf for IE8 compatibility.

Signed-off-by: Alexander Shorin <kxepal@apache.org>
  • Loading branch information...
1 parent b22f2a4 commit 77724c94b959ebe4feb124e21dfbad504f50f824 @ziggythehamster ziggythehamster committed with kxepal Mar 3, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 share/www/script/futon.js
@@ -240,7 +240,7 @@ function $$(node) {
if (userCtx.name) {
$("#userCtx .name").text(userCtx.name).attr({href : $.couch.urlPrefix + "/_utils/document.html?"+encodeURIComponent(r.info.authentication_db)+"/org.couchdb.user%3A"+encodeURIComponent(userCtx.name)});
- if (userCtx.roles.indexOf("_admin") != -1) {
+ if ($.inArray("_admin", userCtx.roles) != -1) {
$("#userCtx .loggedin").show();
$("#userCtx .loggedinadmin").show();
$(".serverAdmin").removeAttr('disabled'); // user is a server admin
@@ -266,7 +266,7 @@ function $$(node) {
});
}
}
- } else if (userCtx.roles.indexOf("_admin") != -1) {
+ } else if ($.inArray("_admin", userCtx.roles) != -1) {
$("#userCtx .adminparty").show();
$(".serverAdmin").removeAttr('disabled');
} else {

0 comments on commit 77724c9

Please sign in to comment.