tags:

views:

184

answers:

0

Hi! I tried to edit the tinymce insertLayer plugin like "onclick of textarea of tinymce editor it opens a layer & user can enter text only on there." i can get the mouse click position and able to create the layer on that particular position but problem is default it is not getting focus. can any one help me that how can I put focus after creating layer. or any hints that how can tinymce handle focus on multi layer?

by this setup in init i am getting mouse click and click position and call the insertlayer function

setup : function(ed) {
            // Display an alert onclick
            ed.onClick.add(function(ed, e) {
                if(e.which==1){
                    ed.execCommand("mceInsertLayer",e.clientX,e.clientY); 
                    //moveToText(document.getElementById(x+"asd"+y),e.clientX,e.clientX)
                }
            });

        }

and edit the layer plugin insert layer as

_insertLayer:function(x,y){
var a=this.editor,
b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));
if(x==''||x==null){x=b.x;}
if(y==''||y==null){y=b.y;}
a.dom.add(a.getBody(),"div",
{style:{display:"block",position:"absolute",left:x,top:y>0?y:20),
width:100,height:100,zindex:200000},"id":x+"asd"+y,
"class":"mceItemVisualAid"},
a.selection.getContent()||a.getLang("layer.content"));
    }

by this way i am creating layer on that click position. it is creating successfully a layer on that click position.But that created layer is not getting the focus... can any one help me how do i put focus on that layer........

Thanks & Regards, Subhra Jyoti Majumdar [email protected] [email protected]