* <http://www.gnu.org/licenses/>.
*/
-CRM.$(function($) {
+(function($) {
function loadProfile(gid, success) {
- $.get('/drupal/civicrm/profile/edit', {
+ $.get('/civicrm/profile/edit', {
gid: gid,
json: 1
}, success);
.value();
}
+ // Support older versions of jQuery that don't parse the JSON by
+ // default.
+ profile = _.isString(profile) ? JSON.parse(profile): profile;
var form = $('<form' + profile.attributes + '></form>');
form.append(profile.requirednote)
.append.apply(form, renderFields());
$('#info-loading').remove();
- $('#crm-main-content-wrapper').append(form);
+ $('#info-form').append(form);
}
$(document).ready(function() {
loadProfile(memberDashboard.profileId, renderProfile);
});
-});
+})(jQuery);