karthick2014 / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
0 stars 0 forks source link

Set a clear() function. #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
A function to clear all text from the control. Perhaps to catch the
form.reset action and clear it.

Something working like this.

{{{
// Initialize the control
$('#wysiwyg').wysiwyg();

// Clear all text from it
$('#wysiwyg').clear();
}}}

Original issue reported on code.google.com by joksnet on 27 Mar 2008 at 9:57

GoogleCodeExporter commented 8 years ago
Today's alternative

{{{
$('a[href="#clear"]').click(function()
{
    var control = $.data( $('#wysiwyg')[0], 'wysiwyg' );
        control.setContent('');
        control.saveContent();

    return false;
});
}}}

Original comment by joksnet on 27 Mar 2008 at 9:59

GoogleCodeExporter commented 8 years ago
Fixed at r18. The new syntax is:

{{{
$('#wysiwyg').wysiwyg('clear');
}}}

Original comment by joksnet on 31 Mar 2008 at 8:59