Commits

Luke Plant  committed 1242916

Removed some duplication of information.

  • Participants
  • Parent commits 961d363

Comments (0)

Files changed (1)

File semanticeditor/media/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

     elem.before(newelem);
     var new_id = command.name + "_" + sect_id; // duplication with do_command
     newelem.attr('id', new_id);
-    this.update_style_display(new_id);
     return new_id;
 };
 
         alert("Cannot use this command on current element.");
         return;
     }
-    var new_id = command.name + "_" + sect_id; // duplication with insert_command_block
+    // newrow and newcol are the only commands at the moment.
+    // We handle both using inserted blocks
+    var new_id = this.insert_command_block(sect_id, command);
     this.register_section(new_id);
     this.presentation_info[new_id].push(command);
-    // newrow and newcol are the only commands at the moment.
-    // We handle both using inserted blocks
-    this.insert_command_block(sect_id, command);
+    this.update_style_display(new_id);
 };
 
 PresentationControls.prototype.insert_command_blocks = function() {
         for (var i = 0; i < presinfos.length; i++) {
             var pi = presinfos[i];
             if (pi.prestype == 'command') {
+                // key = e.g. 'newrow_p_1', we need 'p_1'
                 var id = key.split('_').slice(1).join('_');
                 this.insert_command_block(id, this.command_dict[pi.name]);
             }