Skip to content

Commit

Permalink
Editor: Добавлен метод onShow
Browse files Browse the repository at this point in the history
  • Loading branch information
deniart committed Aug 28, 2015
1 parent 21a6bdf commit 5779fcb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/components/editor/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ $.widget( "livestreet.lsEditor", {
this.element[ this.strategy ]( this.options );
},

/**
* Метод необходимо вызывать при отображении редактора который до этого был скрыт.
* Это необходимо для того чтобы у редакторов, которые криво иниц-ся после отображения, была возможность переиниц-ся.
*/
onShow: function () {
this.element[ this.strategy ]( 'onShow' );
},

/**
* Вставка текста
*
Expand Down
7 changes: 7 additions & 0 deletions frontend/components/editor/js/editor.markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ $.widget( "livestreet.lsEditorMarkup", {
});
},

/**
*
*/
onShow: function () {
return;
},

/**
* Вставка текста
*
Expand Down
15 changes: 15 additions & 0 deletions frontend/components/editor/js/editor.visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,24 @@
* @private
*/
_create: function () {
this.__init();
},

/**
*
*/
__init: function () {
this.element.tinymce( $.extend( {}, this.option( 'sets.common' ), this.option( 'sets.' + this.option( 'set' ) ) ) );
},

/**
*
*/
onShow: function () {
this.element.tinymce().destroy();
this.__init();
},

/**
* Вставка текста
*
Expand Down

0 comments on commit 5779fcb

Please sign in to comment.