Warn if there's no slug to append
This commit is contained in:
parent
4bd334e403
commit
9ac2f38042
@ -162,7 +162,13 @@ $(function () {
|
||||
// Note: Heavily connected to HTML in _node_edit_form.jade
|
||||
var slug = $(this).parent().find("input[id*='slug']").val();
|
||||
var widget = '@[' + slug + ']\n';
|
||||
document.getElementById('description').value += widget;
|
||||
|
||||
if (slug) {
|
||||
document.getElementById('description').value += widget;
|
||||
statusBarSet('success', 'Attachment appended to description', 'pi-check');
|
||||
} else {
|
||||
statusBarSet('error', 'Slug is empty, upload something first', 'pi-warning');
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user