2012-02-22 44 views
2

我现在无休止地尝试解决这个令我非常沮丧的情况。我试图让ckEditor在jQuery UI对话框中工作。编辑器是完美的,它用ckeditor皮肤代替textarea,但我无法编辑/添加内容块中的内容。我现在看到的唯一工作解决方案是,如果我点击编辑器中的“源代码”并取消它,我可以添加内容。ckeditor和jquery UI对话框不起作用

我的实践纯粹只是<script type='text/javascript' src='ckeditor/ckeditor.js'></script>,我还没有添加任何额外的信息/代码。有任何想法吗?

回答

2

有同样的问题,

从模式消除影响帮助: 删除:

show: "scale", 
hide: "puff", 

现在,我的电话是这样的:

$("#report").dialog({ 
     title: "<?php echo caption("REPORT_EDITOR"); ?>", 
     bgiframe: true, 
      autoOpen: false, 
      width: 990, 
      height: 620, 
      modal: true, 

      draggable: true, 
      resizable: true, 
      resizeStop: function(event, ui) { 
       var y = $(event.target).height(); 
       repEditor.resize("99%", y - 10); 
      }, 

      buttons: { 
      'Close': function() { 
       $(this).dialog('close'); 
      } 
      } 
     }); 
+0

+1:非常感谢很多朋友......正在做其他所有猴子修补选项...... :) – naveen 2012-09-19 11:22:18

0

作为替代,以保持“显示“&”隐藏“动画,在”show“事件完成后使用完整回调函数创建编辑器实例:选项”sh“嗷嗷”

$("#report").dialog({ 
    title: "<?php echo caption("REPORT_EDITOR"); ?>", 
    bgiframe: true, 
     autoOpen: false, 
     width: 990, 
     height: 620, 
     modal: true, 

     // start my suggestion 
     show: { 
      effect: "scale", 
      complete: function() { 
      $("#selector").ckeditor(); 
      } 
     }, 

     hide: "puff", 
     // end my suggestion 

     draggable: true, 
     resizable: true, 
     resizeStop: function(event, ui) { 
      var y = $(event.target).height(); 
      repEditor.resize("99%", y - 10); 
     }, 

     buttons: { 
     'Close': function() { 
      $(this).dialog('close'); 
     } 
     } 
    }); 
2

的jQuery UI的版本(1.10+)和jQuery(1.10+)和CKEditor的3.6,this solution似乎工作:

_moveToTop: function(event, silent) { 
    var $parent = this.uiDialog.parent(); 
    var $elementsOnSameLevel = $parent.children(); 

    var heighestZIndex = 0; 
    $.each($elementsOnSameLevel, function(index, element) { 
     var zIndexOfElement = $(element).css('z-index'); 
     if (zIndexOfElement) { 
      var zIndexOfElementAsNumber = parseInt(zIndexOfElement) || 0; 
      if (zIndexOfElementAsNumber > heighestZIndex) { 
       heighestZIndex = zIndexOfElementAsNumber; 
      } 
     } 
    }); 
    var currentZIndex = this.uiDialog.css('z-index'); 

    var moved; 
    if (currentZIndex >= heighestZIndex) { 
     moved = false; 
    } else { 
     this.uiDialog.css('z-index', heighestZIndex + 1); 
     moved = true; 
    } 

    if (moved && !silent) { 
     this._trigger("focus", event); 
    } 

    return moved; 
} 

您可以编辑该文件在 - (不推荐),或者只是在jQuery-UI之后,但在创建对话框之前,在一个单独的JS文件中覆盖默认的jQuery-UI功能。

$.widget("ui.dialog", $.ui.dialog, { 
    _moveToTop: function(event, silent) { 
     //Logic from above 
    } 
});