ckeditor模糊和对话框 [英] ckeditor blur and dialog

查看:122
本文介绍了ckeditor模糊和对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模糊功能附加到我的ckeditor像这样

  editor = CKEDITOR.instances.fck; 
editor.on(blur,function(e){
alert(hello);
});

你和我吗?



我点击闪光按钮编辑器模糊,并导致警报显示。



如何阻止这种情况发生,仍然得到警报出现其他时间,

解决方案

只要用户离开编辑区



<我们正在处理黑客,这里是我喜欢用来解决这个问题。关键是CKE对其下拉类型控件使用iFrames(颜色选择器和背景颜色,字体大小,字体类型)

  editor.on(blur,function(e){
if($(document.activeElement).get(0).tagName.toLowerCase()!=iframe){
//你的代码在这里为真正的模糊事件
}
});


I have a blur function attached to my ckeditor like so

editor = CKEDITOR.instances.fck;
editor.on("blur",function(e){
    alert("hello");
});

you with me ?

now when I click on the flash button the editor blurs and causes the alert to show.

how to I stop that from happening and still get the alert to appear other times like when the user leave the editor area

thanks again

解决方案

As long as we're working on hacks, here's what I like to use to solve this problem. The key is that CKE uses iFrames for their drop-down type controls (color picker and background color, font size, font type)

 editor.on("blur", function(e) {
  if ($(document.activeElement).get(0).tagName.toLowerCase() != "iframe") {
      // your code here for "real" blur event
  }
});

这篇关于ckeditor模糊和对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆