v1.18.x
barisusakli 10 years ago
parent 7397d98647
commit 2b493964d0

@ -138,7 +138,7 @@ define('admin/manage/category', [
});
// Parent Category Selector
$('button[data-action="setParent"]').on('click', Category.launchParentSelector);
$('button[data-action="setParent"], button[data-action="changeParent"]').on('click', Category.launchParentSelector);
$('button[data-action="removeParent"]').on('click', function() {
var payload= {};
payload[ajaxify.data.category.cid] = {
@ -149,7 +149,8 @@ define('admin/manage/category', [
if (err) {
return app.alertError(err.message);
}
ajaxify.refresh();
$('button[data-action="removeParent"]').parent().addClass('hide');
$('button[data-action="setParent"]').removeClass('hide');
});
});
@ -268,7 +269,8 @@ define('admin/manage/category', [
}
modal.modal('hide');
ajaxify.refresh();
$('button[data-action="removeParent"]').parent().removeClass('hide');
$('button[data-action="setParent"]').addClass('hide');
});
});
});

@ -17,15 +17,12 @@
<div class="col-xs-12">
<div class="form-group">
<label for="cid-{category.cid}-parentCid">Parent Category</label>
<!-- IF category.parent.name -->
<br />
<div class="btn-group">
<button type="button" class="btn btn-default" data-action="setParent" data-parentCid="{category.parent.cid}"><i class="fa {category.parent.icon}"></i> {category.parent.name}</button>
<br/>
<div class="btn-group <!-- IF !category.parent.name -->hide<!-- ENDIF !category.parent.name-->">
<button type="button" class="btn btn-default" data-action="changeParent" data-parentCid="{category.parent.cid}"><i class="fa {category.parent.icon}"></i> {category.parent.name}</button>
<button type="button" class="btn btn-warning" data-action="removeParent" data-parentCid="{category.parent.cid}"><i class="fa fa-times"></i></button>
</div>
<!-- ELSE -->
<button type="button" class="btn btn-default form-control" data-action="setParent"><i class="fa fa-sitemap"></i> (None)</button>
<!-- ENDIF category.parent.name -->
<button type="button" class="btn btn-default form-control <!-- IF category.parent.name -->hide<!-- ENDIF category.parent.name-->" data-action="setParent"><i class="fa fa-sitemap"></i> (None)</button>
</div>
</div>
</fieldset>

Loading…
Cancel
Save