Commits

Luke Plant committed 1242916

Removed some duplication of information.

Comments (0)

Files changed (1)

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]);
             }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.