リッチテキストフィールドのデザインモードがソート可能なLI内にあるときに問題が発生します。問題は、LIを新しい位置にドラッグすると、designModeが 'Off'に変わるということです。正しいiframeをターゲットに設定することはできますが、designModeを元に戻すように指示すると無視されるようですが、なぜこれが起こっているのか誰にもわかりますか?読んでくれてありがとう。iframeの内容をjqueryUIのソート可能なリストアイテム内に編集可能
編集:jfiddle例:https://jsfiddle.net/LcLfaa8j/2/
function getRichTextField(itemId) {
console.log('get rich text field');
return document.getElementById('rtf-iframe-' + itemId);
}
$(ドキュメント).ready(関数(){
getRichTextField("sort-textItem-1").contentWindow.document.designMode = "On";
getRichTextField("sort-textItem-2").contentWindow.document.designMode = "On";
$("#text-areas").sortable({
axis: 'y',
opacity: 0.8,
tollerence: 'pointer',
update: function(event, ui) {
var order = $(this).sortable("serialize", { key: "order" });
console.log("New Order = " + order);
console.log('the iframe that was moved designMode is now Off...');
var richText = getRichTextField($(this).data().uiSortable.currentItem.attr('id'));
console.log('TEST: the current is ' + $(this).data().uiSortable.currentItem.attr('id') + ' and designMode = ' + richText.contentWindow.document.designMode + ' doubleCheckOfRTFid = ' + $(richText).attr('id') + ' class = ' + $(richText).attr('class'));
richText.contentWindow.document.designMode = "On";
console.log('just attempted to turn designMode back on... but it gets ignored');
}
});
})。
私は自信を持って、誰も何が起こっているのか分からないと言うことができます。漠然とした質問に対する有用で具体的な回答は得られません。問題を示す例を含める必要があります。誰も来ないし、あなたのためにすべての足をやることはありません。 – LinuxDisciple
は頭を上げて、現時点での例を掲載しています。 – RON2015
https://jsfiddle.net/LcLfaa8j/2/私は、designModeがオンの2つのiframeを持つ小さな例を作成しました。それらの中にあるLIはソート可能です。それらを再ソートし、そのうちの1つのみのdesignModeに注目してくださいクリックして新しい位置にドラッグすると、designModeがオフになり、それを元に戻す試みが失敗します。 – RON2015