}
</style>
<script type="text/javascript">
- cj(function () {
+ cj(function () {
cj("#navigation-tree").jstree({
plugins : [ "themes", "json_data", "dnd","ui", "crrm","contextmenu" ],
json_data : {
ajax:{
dataType : "json",
- async : true,
url : {/literal}"{crmURL p='civicrm/ajax/menu' h=0 q='key='}{crmKey name='civicrm/ajax/menu'}"{literal}
- }
+ },
+ progressive_render: true
},
themes: {
"theme": 'classic',
items: {
create : false,
ccp : {
- label : "Edit",
+ label : "{/literal}{ts escape='js'}Edit{/ts}{literal}",
visible : function (node, obj) { if(node.length != 1) return false;
return obj.check("renameable", node); },
action : function (node, obj) {
var nid = cj(node).prop('id');
var nodeID = nid.substr( 5 );
var editURL = {/literal}"{crmURL p='civicrm/admin/menu' h=0 q='action=update&reset=1&id='}"{literal} + nodeID;
- location.href = editURL;
+ CRM.loadForm(editURL).on('crmFormSuccess', function() {
+ cj("#navigation-tree").jstree('refresh');
+ cj("#reset-menu").show( );
+ });
},
submenu : false
}
});
});
});
+ cj('#new-menu-item a.button').click(function() {
+ CRM.loadForm(this.href).on('crmFormSuccess', function() {
+ cj("#navigation-tree").jstree('refresh');
+ cj("#reset-menu").show( );
+ });
+ return false;
+ })
});
</script>
{/literal}