jquery aloha-editor,Aloha.trigger

时间:2013-03-06 08:40:27

标签: javascript jquery html5

我对页面中的Aloha.trigger有疑问 http://aloha-editor.org/guides/events.html#aloha-editable-created-event 如何实际使用

Aloha.trigger( 'aloha-smart-content-changed', {
    'editable'          : , // object of the editable
    'keyIdentifier'     : , // char | null
    'keyCode'           : , // char | null
    'char'              : , // char | null
    'triggerType'       : , // keypress, idle, blur, paste, block-change
    'snapshotContent'   : , // snapshot content of the editable as HTML String
} );

Aloha.trigger( 'aloha-editable-created', [
    // jQuery object reference of an editable
] );

实际上?我找不到eny的例子。只能找到Aloha.bind

Aloha.bind( 'aloha-editable-created', function( jEvent, editable ) {
    console.log( 'editable "' + editable.getId() + '" created' );
});

谢谢

1 个答案:

答案 0 :(得分:0)

使用像这样的东西

Aloha.bind( 'aloha-smart-content-changed', function( jEvent, aEvent){
      // Get updated content
  console.log( this, jEvent, aEvent.getSnapshotContent() );
      // Get the object that is updated - jQ object 
  console.log($(aEvent.editable.obj).eq(0);
});