StevenDevooght / tinyMCE-mention

Mention/Autocomplete plugin for tinyMCE WYSIWYG editor.
http://stevendevooght.github.io/tinyMCE-mention/
221 stars 96 forks source link

Internet Explorer 11 OnClick -> Item disappears #9

Closed TobiasW00 closed 10 years ago

TobiasW00 commented 10 years ago

Hello! Thank you for this nice piece of code! If I use Firefox or Chrome I can click on the Element and it gets inserted in the textbox. If I do the same on IE 11 the selectbox disappers and the item is not inserted. Any Idea?

Thank you!

StevenDevooght commented 10 years ago

I'll have a look if I can fix this problem.

StevenDevooght commented 10 years ago

I can't reproduce this issue on http://cognistreamer.github.io/tinyMCE-mention/. Are you using the latest version of tinyMCE(4.0.26)?

jchafik commented 10 years ago

I was having this same issue with and older version of your code. Looks like it was fixed by the following:

https://github.com/CogniStreamer/tinyMCE-mention/commit/c5c9d198e5ca7c29cece1b0f535328ef416b9e5d#diff-5866783d4482da3b78bd678f15d593d5

StevenDevooght commented 10 years ago

Thanks @JacobC123, I'll close this one.

TobiasW00 commented 10 years ago

Thanks Steven! I'm sorry I didn’t respond quickly. I updated my tinymce Version, but der Problem still exists: http://youtu.be/zodIdDiYyLM

Maybe I have an error in my own js. Could y do a quick review? Maybe I did implemented it the wrong way. Thank you!

Bug: http://youtu.be/zodIdDiYyLM

Code: tinymce.init({ selector: "#personinputboxtex", menubar:false, height : "34", plugins: "autoresize,paste,mention", toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent ", mentions: { delimiter: ['@', '#','['], source: function (query, process, delimiter) {

// Do your ajax call
// When using multiple delimiters you can alter the query depending on the delimiter used  $(inputPersonbox).find('.dummy').html(); 
if (delimiter === '@') {

            var dataPersonString = "term=" + query
            $.ajax({
            url: "JSON/GETPERSONS",
            dataType: "json",
            data: dataPersonString,
            success: function( data, textStatus, jqXHR) {
            process(data);              
            },
            error: function(jqXHR, textStatus, errorThrown){                
                 console.log( textStatus);
            }
        });
}
    if (delimiter === '#') {

            var dataString = "term=" + query    
            $.ajax({
            url: "JSON/GETTAGSS",
            data: dataString,
            dataType: "json",
            success: function( data, textStatus, jqXHR) {           
            process(data);              
            },
            error: function(jqXHR, textStatus, errorThrown){                
                 console.log( textStatus);
            }
        });
}
//
        if (delimiter === '[') {

            var dataString = "term=" + query        
            $.ajax({
            url: "/list/json",
            data: dataString,
            dataType: "json",
            success: function( data, textStatus, jqXHR) {           
            process(data);              
            },
            error: function(jqXHR, textStatus, errorThrown){                
                 console.log( textStatus);
            }
        });
}

}, insert: function(item) {

try {

if (item.listid){ var listid = item.listid; return '<a data-listid=\"' + listid + '\" href=\"/list/'+ listid +'/\">[' + item.label + ']'; } if (item.personid){ return '<a href=\"/profile/'+ item.personid +'/\">@' + item.name + ''; } if (item.id){ return '<a href=\"/tag/' + item.id + '/\" alt=\"Taglink\">' + item.name + ''; }
} catch(e) { alert(e); return '' + item.name + ''; }
} } });

jchafik commented 10 years ago

@TobiasW00 I'd recommend that you test the demo at http://cognistreamer.github.io/tinyMCE-mention/. If it's working there, it's probably an issue with your code. And I'd recommend StackOverflow for code related questions. GitHub should really be for development, not support - open source devs are already giving enough away for free :) However, if you're able to reproduce there and it is a bug, then let someone here know!

StevenDevooght commented 10 years ago

@TobiasW00, I did a quick test using multiple delimiters and didn't experience any problems. I suggest you try to debug your local code and find out what is causing the problem.