Opened 12 years ago

Closed 11 years ago

#9077 closed New Feature (invalid)

jQuery adapter - use valHooks

Reported by: AlexW Owned by: Piotr Jasiun
Priority: Normal Milestone: CKEditor 4.2
Component: General Version: 4.0
Keywords: jQuery Cc:

Description

The jQuery adapter can make use of the valHooks feature instead of overriding val().

if ( CKEDITOR.config.jqueryOverrideVal ) {
    jQuery.valHooks[ 'textarea' ] = {
        get: function( elem ) {
            var $this = jQuery( elem ),
                editor = $this.data( 'ckeditorInstance' );
            
            if ( editor ) return editor.getData();
        },
        set: function( elem, value ) {
            var $this = jQuery( elem ),
                editor = $this.data( 'ckeditorInstance' );
            
            if ( editor ) editor.setData( value );
        }
    };
}

Change History (6)

comment:1 Changed 11 years ago by Jakub Ś

Keywords: jQuery added
Status: newconfirmed
Version: 4.0

valHooks allow you to override the default behaviour of .val() for any jQuery-accessible object

We rewriting jQuery adapter at the moment and we will be using valHooks (we are already using them).

This ticket can be included into #10281 (umbrella ticket for adapter).

comment:2 Changed 11 years ago by Piotr Jasiun

Owner: set to Piotr Jasiun
Status: confirmedreview

comment:3 Changed 11 years ago by Piotr Jasiun

Milestone: CKEditor 4.2

comment:4 Changed 11 years ago by Piotr Jasiun

in branch/ticket #10281

comment:5 Changed 11 years ago by Piotr Jasiun

Status: reviewassigned

comment:6 Changed 11 years ago by Olek Nowodziński

Resolution: invalid
Status: assignedclosed

Due to the asynchronous nature of editor.setData() and implemented promises we decided to not to use valHooks but to override val().

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy