Есть javascript код
Drupal.theme.prototype.multipage = function (settings) {
var controls = {};
controls.item = $('<span class="multipage-button"></span>');
controls.nextLink = $('<input type="button" class="form-submit multipage-link-next" value="" />');
controls.nextTitle = Drupal.t('Next page');
controls.item.append(controls.nextLink.val(controls.nextTitle));
if (!settings.has_next) {
controls.nextLink.hide();
}
return controls;
};
Как обернуть controls.item в html чтобы получить такой код?
<div class="row">
<div class="col-sm-offset-2 col-sm-8">
<div class="col-sm-9 col-sm-offset-3">
<span class="multipage-button">
и т.д...
</span>
</div>
</div>
</div>
Пробовал так
Drupal.theme.prototype.multipage = function (settings) {
var controls = {};
controls.item = $('<span class="multipage-button"></span>');
controls.nextLink = $('<input type="button" class="form-submit multipage-link-next" value="" />');
controls.nextTitle = Drupal.t('Next page');
controls.item.wrap('<div class="row"><div class="col-sm-offset-2 col-sm-8"><div class="col-sm-9 col-sm-offset-3"></div></div></div>');
controls.item.append(controls.nextLink.val(controls.nextTitle));
if (!settings.has_next) {
controls.nextLink.hide();
}
return controls;
};