TinyMCE 下拉列表在 MDL 模式中不起作用
TinyMCE dropdowns not working in MDL modal
我正在尝试在Material Design Lite模式中运行TinyMCE,但是用于选择字体系列和字体大小的下拉列表不起作用:
JSFiddle 示例:
https://jsfiddle.net/m11q7dzj/
.CSS:
.mdl-dialog{
width: 500px;
height: 500px;
}
.editable{
width: 500px;
height: 450px;
outline: 1px dotted #333;
}
.HTML:
<dialog class="mdl-dialog">
<form action="#">
<div class="mdl-textfield mdl-js-textfield">
<div class="editable-parent"></div>
<div class="editable">Click to edit...</div>
</div>
</form>
</dialog>
<input id="show-dialog" type="submit" value="Open Editor" class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent" />
JavaScript:
var dialog = document.querySelector('dialog');
var showDialogButton = document.querySelector('#show-dialog');
if (!dialog.showModal) {
dialogPolyfill.registerDialog(dialog);
}
showDialogButton.addEventListener('click', function () {
dialog.showModal();
tinymce.init({
selector: 'div.editable',
inline: true,
height: '480px',
max_height: 500,
fixed_toolbar_container: ".editable-parent",
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt",
toolbar: 'fontselect | fontsizeselect',
menubar: false
});
});
我添加了以下代码,它正在工作:
setup: function (ed) {
ed.on('focus', function (args) {
$(dialog).on("click", ".mce-listbox", function() {
$("body > div[id^=mceu_]").appendTo(dialog);
});
});
}
https://jsfiddle.net/m11q7dzj/1/
相关文章:
- Ajax模式下的Jquery Select2 V4在IE9中不起作用
- Angular$scope在模式窗口内不起作用
- jQuery日期选择器在Codeigniter和Bootsrap模式表单中不起作用
- 脚本在我的引导模式中不起作用
- 谷歌浏览器模式正则表达式在使用setCustomValidity动态创建表单时不起作用
- 猫鼬混合模式不起作用
- 模式弹出窗口内的按钮点击不起作用
- ng模式验证在safari中不起作用
- 我试图使用引导模式类来制作一个弹出注册表单,但弹出没有'不起作用
- 使用引导模式形式的ADD不起作用
- 触摸事件在模式弹出窗口上不起作用
- 代码仅在调试器模式下工作,断点位于 Consol.log否则不起作用
- KnockoutJS - 引导程序 3 模式绑定不起作用
- 火狐浏览器 iframe 设计模式不起作用
- ASP.NET MVC 验证在引导模式上不起作用
- 简单的模式不起作用
- 关闭图标在使用 AngularJs 的引导模式上不起作用
- JavaScript 模块模式不起作用
- jQuery 引导选项卡在自定义模式中不起作用(不是引导模式,而是我自己的版本)
- 匹配模式不起作用