我在启用了ajax的Foundation Reveal框中使用了TinyMCE .现在TinyMCE在第一次加载时踢,但是如果我关闭盒并再次打开它不会触发:(
我有其他脚本,如选择和屏蔽输入在完全相同的前查询中触发,但是当我第二次重新加载它时,TinyMCE将不会重新初始化
这是我目前的代码,我正在尝试这个问题:
$(document).on('opened.fndtn.reveal', '[data-reveal]', function () {
$("#expenseUser, #expenseVendorID, #expenseCategoryID, #expenseAccidentID").chosen({disable_search_threshold: 5, width: '365px'});
$("#expOdo").mask("999999",{placeholder:"0"});
$('.datePicker').each(function() {
$(this).datetimepicker({
addSliderAccess: true,
sliderAccessArgs: {touchonly: false},
changeMonth: true,
changeYear: true,
altField: "#"+$(this).attr('id')+"Alt",
altFieldTimeOnly: false,
altFormat: "yy-mm-dd",
altTimeFormat : "HH:mm:ss",
dateFormat: "D, d MM yy",
timeFormat: "hh:mmtt"
});
});
tinymce.execCommand('mceRemoveEditor',true,"textarea#expenseComments");
tinymce.execCommand('mceAddEditor',true,"textarea#expenseComments");
tinyMCE.init({selector: "textarea#expenseComments",menubar : false,toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright"});
});
Run Code Online (Sandbox Code Playgroud)
更新
我已经尝试过运气,但是我认为这是正确的道路吗?
$(document).on('opened.fndtn.reveal', '[data-reveal]', function () …Run Code Online (Sandbox Code Playgroud)