在隐藏的tinyMce元素上应用execCommand

时间:2018-08-04 13:37:20

标签: tabs tinymce tinymce-4

我在Web应用程序中使用Bootstrap JS Tab,每个标签具有多个tinyMce元素。

我的目标是即使在隐藏的标签中也将字体样式更改为所有tinyMce元素。

如本示例jsfiddle所示,但问题是它仅适用于可见标签,而不适用于隐藏标签?

经过数小时的尝试和错误,我发现在应用import cython cimport cython from licpp.map import map as mapcpp from cython.operator import dereference, postincrement def it_through_map(dict mymap_of_int_int): # python dict to map cdef mapcpp[int,int] mymap_in = mymap_of_int_int cdef mapcpp[int,int].iterator it = mymap_in.begin() while(it != mymap.end()): # let's pretend here I just want to print the key and the value print(dereference(it).first) # print the key print(dereference(it).second) # print the associated value postincrement(it) # Increment the iterator to the net element 之前需要删除文本选择,因此我制定了此解决方案solved example

通过添加此行

execCommand

在应用 // to remove any text selection. window.getSelection().collapse(null, 0); 之前,我觉得这不是干净的解决方案。

我的问题:

  1. 我不明白为什么会从一开始就发生这种情况?
  2. 这是解决我问题的最好方法吗?

0 个答案:

没有答案
相关问题