Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2008-07-29 18:17:19

thinice
New member
From: Fergus Falls, MN
Registered: 2008-07-29
Posts: 5
Website

getSelection() in IE7 ?

I have been trying to get this to work -all- day in IE.

I am getting absolutely no output from IE. No matter what I try to do. What am I missing?

function CSSPicker(editor, args) {
    this.editor = editor;
    var CSSPicker = this;
}

CSSPicker._pluginInfo = {
    name    : "CSSPicker",    
    version : "2008-07-00"
};

CSSPicker.prototype.onGenerateOnce = function() {
    var editor = this.editor;
    var CSSPicker = this;
    editor._cssPicker = editor.addPanel("right");
    
    editor._cssPicker.appendChild(CSSPicker.gen());
    
    editor.showPanel(editor._cssPicker);
};

CSSPicker.prototype.gen = function() {
    var editor = this.editor;
    this.d = document.createElement("div");
    this.d.innerHTML = " - TEST - ";
    this.d.href = 'javascript:void(0)';
    this.d.onclick = function() {
        //var sel = editor._getSelection(); // - Works in FF
        var sel = editor._createRange(editor._getSelection()); //supposed to work in IE?
        alert(sel.text);
    };
    return this.d;
};

[url]http://rovangju.blogspot.com[/url] | [url]http://bitbucket.org/rovangju/[/url]

Offline

#2 2008-07-29 18:24:58

thinice
New member
From: Fergus Falls, MN
Registered: 2008-07-29
Posts: 5
Website

Re: getSelection() in IE7 ?

it should be noted this is with 0.95 / IE7, the objective is to get the alert in the 'gen' function to output the selected text.


[url]http://rovangju.blogspot.com[/url] | [url]http://bitbucket.org/rovangju/[/url]

Offline

#3 2008-07-29 21:48:32

thinice
New member
From: Fergus Falls, MN
Registered: 2008-07-29
Posts: 5
Website

Re: getSelection() in IE7 ?

Problem solved. It seems as though you need to hook the call for getSelection/getSelectedHTML to a timeout.


[url]http://rovangju.blogspot.com[/url] | [url]http://bitbucket.org/rovangju/[/url]

Offline

Board footer

Powered by FluxBB