v1.18.x
barisusakli 9 years ago
parent 38cd153077
commit ee8bb8d908

@ -1,5 +1,5 @@
"use strict"; "use strict";
/*global define, app, socket, ajaxify, RELATIVE_PATH, bootbox */ /*global define, app, socket, ajaxify, RELATIVE_PATH, bootbox, templates */
define('admin/manage/category', [ define('admin/manage/category', [
'uploader', 'uploader',
@ -139,6 +139,7 @@ define('admin/manage/category', [
return app.alertError(err.message); return app.alertError(err.message);
} }
$('button[data-action="removeParent"]').parent().addClass('hide'); $('button[data-action="removeParent"]').parent().addClass('hide');
$('button[data-action="changeParent"]').parent().addClass('hide');
$('button[data-action="setParent"]').removeClass('hide'); $('button[data-action="setParent"]').removeClass('hide');
}); });
}); });
@ -262,10 +263,16 @@ define('admin/manage/category', [
if (err) { if (err) {
return app.alertError(err.message); return app.alertError(err.message);
} }
var parent = categories.filter(function(category) {
return category && parseInt(category.cid, 10) === parseInt(parentCid, 10);
});
parent = parent[0];
modal.modal('hide'); modal.modal('hide');
$('button[data-action="removeParent"]').parent().removeClass('hide'); $('button[data-action="removeParent"]').parent().removeClass('hide');
$('button[data-action="setParent"]').addClass('hide'); $('button[data-action="setParent"]').addClass('hide');
var buttonHtml = '<i class="fa ' + parent.icon + '"></i> ' + parent.name;
$('button[data-action="changeParent"]').html(buttonHtml).parent().removeClass('hide');
}); });
}); });
}); });

Loading…
Cancel
Save