chutier icon added to corpus map nodepopup
This commit is contained in:
@@ -20,18 +20,7 @@
|
||||
function onClickAjaxLink(e){
|
||||
console.log('studio onClickAjaxLink chutier');
|
||||
e.preventDefault();
|
||||
// var $this = $(this);
|
||||
addRemoveToChutier($(this));
|
||||
// switch($this.attr('action')){
|
||||
// case 'add':
|
||||
// // TODO: get target chutier
|
||||
// addToChutier($this);
|
||||
// break;
|
||||
// case 'remove':
|
||||
// // TODO: if we use more than one chutoer per user get target chutier
|
||||
// removeFromChutier($this);
|
||||
// break;
|
||||
// }
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -51,6 +40,12 @@
|
||||
|
||||
function onActionToChutierDone($link, data){
|
||||
console.log('onActionToChutierDone',data);
|
||||
$('body').trigger({
|
||||
'type':'chutier-action-done',
|
||||
'action_done':data.action_done,
|
||||
'new_action':data.action_done == 'add' ? 'remove' : 'add',
|
||||
'target_id':$link.attr('target_id'),
|
||||
});
|
||||
$link.replaceWith(data.new_link);
|
||||
initAjax();
|
||||
};
|
||||
|
||||
@@ -97,6 +97,7 @@ class ChutierController extends ControllerBase {
|
||||
'status' => $status,
|
||||
'message' => $message,
|
||||
'new_link' => $new_link,
|
||||
'action_done' => $action,
|
||||
);
|
||||
$response->setData($data);
|
||||
return $response;
|
||||
|
||||
@@ -284,7 +284,7 @@ class Chutier extends ContentEntityBase implements ChutierInterface {
|
||||
);
|
||||
$url = Url::fromRoute('edlp_studio.chutier_controller_ajax_add_content', $args, array(
|
||||
'attributes' => array(
|
||||
'class' => ['chutier-link','chutier-ajax-link'],
|
||||
'class' => ['chutier-icon','chutier-link','chutier-ajax-link'],
|
||||
'action' => $action,
|
||||
'target_id' => $id,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user