Ticket #1555: dblclickList.diff

File dblclickList.diff, 1.5 KB (added by ejucovy, 9 years ago)

plugin sets config.dblclickList and lets core handle the rest

  • plugins/DoubleClick/DoubleClick.js

     
    1515 
    1616DoubleClick._pluginInfo = { 
    1717  name          : "DoubleClick", 
    18   version       : "1.0", 
     18  version       : "1.1", 
    1919  developer     : "Marijn Kampf", 
    2020  developer_url : "http://www.marijn.org", 
    2121  c_owner       : "Marijn Kampf", 
     
    4848 
    4949DoubleClick.prototype.onGenerate = function() { 
    5050  var self = this; 
    51   var doc = this.editordoc = this.editor._iframe.contentWindow.document; 
    52   Xinha._addEvents(doc, ["dblclick"], 
    53           function (event) { 
    54           return self.onDoubleClick(Xinha.is_ie ? self.editor._iframe.contentWindow.event : event); 
    55           }); 
    56   this.currentClick = null; 
    57 }; 
    58  
    59 DoubleClick.prototype.onDoubleClick = function(ev) { 
    60   var target = Xinha.is_ie ? ev.srcElement : ev.target; 
    61   var tagName = target.tagName.toLowerCase(); 
    62  
    63   if (this.editor.dblClickList[tagName] != undefined) { 
    64     this.editor.dblClickList[tagName][0](this.editor, target); 
     51  var config = this.editor.config; 
     52  for( var i in this.editor.dblClickList ) { 
     53      if( typeof i != 'string' ) { 
     54          continue; 
     55      } 
     56      var actions = this.editor.dblClickList[i]; 
     57      if( typeof actions != 'object' ) { 
     58          continue; 
     59      } 
     60      this.editor.config.dblclickList[i] = actions; 
    6561  } 
    66 }; 
    67  No newline at end of file 
     62};