- if(btn.attr('data-btn-type') === 'cmd') {
- var command = btn.attr('data-btn');
- var meta = btn.attr('data-meta');
- if(command === 'new-node') {
- var wlxmlTag = view.getOption('newTag-tag');
- var wlxmlClass = view.getOption('newTag-class');
- if(meta) {
- var split = meta.split('/');
- wlxmlTag = split[0];
- wlxmlClass = split[1];
- }
- sandbox.publish('newNodeRequested', wlxmlTag, wlxmlClass);
- } else {
- sandbox.publish('command', btn.attr('data-btn'), btn.attr('data-meta'));
+
+ if(btnName === 'new-node') {
+ command = 'newNodeRequested';
+ params.wlxmlTag = view.getOption('newTag-tag');
+ params.wlxmlClass = view.getOption('newTag-class');
+ if(meta) {
+ var split = meta.split('/');
+ params.wlxmlTag = split[0];
+ params.wlxmlClass = split[1];