Drupal可折叠字段集脚本,带有调整TinyMCE大小的触发器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Drupal可折叠字段集脚本,带有调整TinyMCE大小的触发器相关的知识,希望对你有一定的参考价值。
This override function for the default Drupal.toggleFieldset function adds code that looks for instances of TinyMCE inside the fieldset and triggers the autoresize on them when the fieldset is opened. Otherwise TinyMCE renders with a weird height.
/** * OVERWRITES Drupal.toggleFieldset in /misc/collapse.js * * Modified to trigger autoresize on tinyMCE textareas inside collapsed fieldsets */ Drupal.toggleFieldset = function(fieldset) { if ($(fieldset).is('.collapsed')) { // Action div containers are processed separately because of a IE bug // that alters the default submit button behavior. var content = $('> div:not(.action)', fieldset); $(fieldset).removeClass('collapsed'); content.hide(); content.slideDown( { duration: 'fast', easing: 'linear', complete: function() { Drupal.collapseScrollIntoView(this.parentNode); this.parentNode.animating = false; $('div.action', fieldset).show(); // >>>> var editors = $(fieldset).find('.mceEditor'); $.each(editors, function() { var instance = tinyMCE.get($(this).attr('id').replace('_parent', '')); // Add a min height it it doesn't have one yet if (instance.plugins.autoresize && instance.plugins.autoresize.autoresize_min_height < 50) { instance.plugins.autoresize.autoresize_min_height = 50; } // Trigger the resize instance.execCommand('mceAutoResize'); }); // >>> }, step: function() { // Scroll the fieldset into view Drupal.collapseScrollIntoView(this.parentNode); } }); } else { $('div.action', fieldset).hide(); var content = $('> div:not(.action)', fieldset).slideUp('fast', function() { $(this.parentNode).addClass('collapsed'); this.parentNode.animating = false; }); } };
以上是关于Drupal可折叠字段集脚本,带有调整TinyMCE大小的触发器的主要内容,如果未能解决你的问题,请参考以下文章
仅在训练折叠上使用带有 SMOTE 过采样的 sklearn 的 RandomizedSearchCV