Changeset 1279


Ignore:
Timestamp:
11/18/10 16:28:35 (7 years ago)
Author:
ejucovy
Message:

whoops - my commit r1278 was wrong: it registered the buttons in the reverse order (DD - DT - DL). rather than building some complicated partial-array-reversal logic here (a full array reversal wouldn't work because of the linebreak and separator items), i'm just going to simplify the whole thing and hard-code the button registrations. I don't think anyone will mind the loss of the linebreak here..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/DefinitionList/DefinitionList.js

    r1278 r1279  
    1010  var self = this; 
    1111  // register the toolbar buttons provided by this plugin 
    12   var toolbar = ["linebreak"]; 
    1312  for (var i = 0; i < bl.length; ++i) { 
    1413    var btn = bl[i]; 
    1514    if (!btn) { 
    16       toolbar.push("separator"); 
    17     } else { 
    18       var id = btn[0]; 
    19       cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "DefinitionList"), false, 
    20              function(editor, id) { 
    21                // dispatch button press event 
    22                self.buttonPress(editor, id); 
    23              }); 
    24       toolbar.push(id); 
     15      continue; 
    2516    } 
     17    var id = btn[0]; 
     18    cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "DefinitionList"), false, 
     19      function(editor, id) { 
     20        // dispatch button press event 
     21        self.buttonPress(editor, id); 
     22      }); 
    2623  } 
    2724 
     
    2926  // If neither of those buttons exists, addToolbarElement puts our buttons 
    3027  // at the beginning of the toolbar, which is good enough. 
    31   for( var i = 0; i < toolbar.length; ++i ) { 
    32     cfg.addToolbarElement(toolbar[i], ["insertunorderedlist", "insertorderedlist"], 1); 
    33   } 
     28  cfg.addToolbarElement("dl", ["insertunorderedlist", "insertorderedlist"], 1); 
     29  cfg.addToolbarElement("dt", "dl", 1); 
     30  cfg.addToolbarElement("dd", "dt", 1); 
    3431} 
    3532 
Note: See TracChangeset for help on using the changeset viewer.