Bachir Soussi Chiadmi 1bc61b12ad first import
2015-04-08 11:40:19 +02:00

26 lines
554 B
JavaScript

(function($) {
/**
* Attach this editor to a target element.
*/
Drupal.wysiwyg.editor.attach.jwysiwyg = function(context, params, settings) {
// Attach editor.
$('#' + params.field).wysiwyg();
};
/**
* Detach a single or all editors.
*/
Drupal.wysiwyg.editor.detach.jwysiwyg = function(context, params) {
var $field = $('#' + params.field);
var editor = $field.data('wysiwyg');
if (typeof editor != 'undefined') {
editor.saveContent();
editor.element.remove();
}
$field.removeData('wysiwyg');
$field.show();
};
})(jQuery);