#19152: Removing Content Picker's dependency on /admin urls

Work Item: 19152

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-10-17 11:21:45 -07:00
parent 287dba24ce
commit f98221d773
3 changed files with 11 additions and 5 deletions

View File

@@ -28,7 +28,8 @@
if (menuText.val().length == 0) {
menuText.val(data.displayText);
}
}
},
baseUrl: '@Url.Content("~/")'
});
});
//]]>

View File

@@ -15,9 +15,13 @@
};
$[callbackName].data = data;
var adminIndex = location.href.toLowerCase().indexOf("/admin/");
if (adminIndex === -1) return;
var url = location.href.substr(0, adminIndex)
var baseUrl = data.baseUrl;
// remove trailing slash if any
if (baseUrl.substr(-1) == '/')
baseUrl.substr(0, baseUrl.length - 1);
var url = baseUrl
+ "/Admin/Orchard.ContentPicker?"
+ "callback=" + callbackName
+ "&" + (new Date() - 0);

View File

@@ -86,7 +86,8 @@
refreshIds();
$('#save-message-@Html.FieldIdFor(m => m.Field.Ids)').show();
}
},
baseUrl: '@Url.Content("~/")'
});
});