Skip to content
Permalink
Browse files

Chromeスリミングペイント対策

リソースツリーのノードを構成するHTMLコードを整理
ノードをdiv要素で囲んでブロックとして明示する
  • Loading branch information...
yama committed Sep 25, 2015
1 parent c1d33cc commit 45205e4dd0667b92d23c36475915128e214ecffe
Showing with 22 additions and 34 deletions.
  1. +9 −8 manager/frames/nodes.php
  2. +13 −26 manager/frames/tree.php
@@ -129,7 +129,7 @@ function getNodes($indent,$parent=0,$expandAll,$output='')
$ph['deleted'] = $deleted;
$ph['nodetitleDisplay'] = '<span class="' . $class . '">' . $nodetitle . '</span>';
$ph['weblinkDisplay'] = $type==='reference' ? '&nbsp;<img src="'.$_style["tree_linkgo"].'">' : '' ;
$ph['pageIdDisplay'] = '<small>('.($modx_textdir==='rtl' ? '&rlm;':'').$id.')</small>';
$ph['pageIdDisplay'] = '<span>('.($modx_textdir==='rtl' ? '&rlm;':'').$id.')</span>';
$ph['draftDisplay'] = $draftDisplay;
$ph['_lang_click_to_context'] = $_lang['click_to_context'];
@@ -228,7 +228,7 @@ function tplPageNode()
id="node[+id+]"
p="[+parent+]"
style="white-space: nowrap;"
>[+spacer+][+pad+]<img
><div>[+spacer+][+pad+]<img
id="p[+id+]"
align="absmiddle"
title="[+_lang_click_to_context+]"
@@ -247,7 +247,7 @@ function tplPageNode()
class="treeNode"
onmousedown="itemToChange=[+id+]; selectedObjectName=[+pagetitle+]; selectedObjectDeleted=[+deleted+]; selectedObjectUrl=[+url+];"
oncontextmenu="document.getElementById([+pid+]).onclick(event);return false;"
title="[+alt+]">[+draftDisplay+][+nodetitleDisplay+][+weblinkDisplay+]</span> [+pageIdDisplay+]</div>
title="[+alt+]">[+draftDisplay+][+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</div></div>
EOT;
return $src;
@@ -256,10 +256,10 @@ class="treeNode"
function getFopenNode()
{
$src = <<< EOT
<div id="node[+id+]" p="[+parent+]" style="white-space: nowrap;">[+spacer+]<img
<div id="node[+id+]" p="[+parent+]" style="white-space: nowrap;"><div>[+spacer+]<img
id="s[+id+]"
align="absmiddle"
style="cursor:pointer"
style="cursor:pointer;"
src="[+_style_tree_minusnode+]"
onclick="toggleNode(this,[+indent+],[+id+],0,[+private_status+]); return false;"
oncontextmenu="this.onclick(event); return false;"
@@ -282,7 +282,7 @@ class="treeNode"
onmousedown="itemToChange=[+id+]; selectedObjectName=[+pagetitle+]; selectedObjectDeleted=[+deleted+]; selectedObjectUrl=[+url+];"
oncontextmenu="document.getElementById([+fid+]).onclick(event);return false;"
title="[+alt+]"
>[+draftDisplay+][+nodetitleDisplay+][+weblinkDisplay+]</span> [+pageIdDisplay+]<div style="display:block">
>[+draftDisplay+][+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</div><div id="c[+id+]" style="display:block;">
EOT;
return $src;
@@ -291,7 +291,7 @@ class="treeNode"
function tplFcloseNode()
{
$src = <<< EOT
<div id="node[+id+]" p="[+parent+]" style="white-space: nowrap;">[+spacer+]<img
<div id="node[+id+]" p="[+parent+]" style="white-space: nowrap;"><div>[+spacer+]<img
id="s[+id+]"
align="absmiddle"
style="cursor: pointer"
@@ -316,7 +316,8 @@ function tplFcloseNode()
class="treeNode"
onmousedown="itemToChange=[+id+]; selectedObjectName=[+pagetitle+]; selectedObjectDeleted=[+deleted+]; selectedObjectUrl=[+url+];"
oncontextmenu="document.getElementById([+fid+]).onclick(event);return false;"
title="[+alt+]">[+draftDisplay+][+nodetitleDisplay+][+weblinkDisplay+]</span> [+pageIdDisplay+]<div style="display:none"></div></div>
title="[+alt+]"
>[+draftDisplay+][+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</div><div id="c[+id+]" style="display:none;"></div></div>
EOT;
return $src;
@@ -199,51 +199,38 @@ function hideMenu() {
function toggleNode(node,indent,id,expandAll,privatenode) {
privatenode = (!privatenode || privatenode == '0') ? '0' : '1';
rpcNode = node.parentNode.lastChild;
rpcNode = document.getElementById('c'+id);
var rpcNodeText;
var loadText = "<?php echo $_lang['loading_doc_tree'];?>";
var signImg = document.getElementById('s'+id);
var folderImg = document.getElementById('f'+id);
if (rpcNode.style.display != 'block') {
if (rpcNode.style.display == 'block') {
// collapse
signImg.src = '<?php echo $_style["tree_plusnode"]; ?>';
//rpcNode.innerHTML = '';
jQuery(rpcNode).hide(100);
openedArray[id] = 0 ;
}
else {
// expand
if(signImg && signImg.src.indexOf('media/style/<?php echo $manager_theme; ?>/images/tree/plusnode.gif')>-1) {
signImg.src = '<?php echo $_style["tree_minusnode"]; ?>';
if(id!=<?php echo $modx->config["site_start"];?>)
folderImg.src = (privatenode == '0') ? '<?php echo $_style["tree_folderopen"]; ?>' :'<?php echo $_style["tree_folderopen_secure"]; ?>';
}
signImg.src = '<?php echo $_style["tree_minusnode"]; ?>';
rpcNodeText = rpcNode.innerHTML;
if (rpcNodeText=="" || rpcNodeText.indexOf(loadText)>0) {
var i, spacer='';
for(i=0;i<=indent+1;i++) spacer+='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
rpcNode.style.display = 'block';
if (rpcNodeText=='') {
//Jeroen set opened
openedArray[id] = 1 ;
//Raymond:added getFolderState()
var folderState = getFolderState();
rpcNode.innerHTML = "<span class='emptyNode' style='white-space:nowrap;'>"+spacer+"&nbsp;&nbsp;&nbsp;"+loadText+"...<\/span>";
jQuery.get('index.php',{'a':'1','f':'nodes','indent':indent,'parent':id,'expandAll':expandAll+folderState},rpcLoadData);
jQuery(rpcNode).show(100);
} else {
rpcNode.style.display = 'block';
jQuery(rpcNode).show(100);
//Jeroen set opened
openedArray[id] = 1 ;
}
}
else {
// collapse
if(signImg && signImg.src.indexOf('media/style/<?php echo $manager_theme; ?>/images/tree/minusnode.gif')>-1) {
signImg.src = '<?php echo $_style["tree_plusnode"]; ?>';
if(id!=<?php echo $modx->config["site_start"];?>)
folderImg.src = (privatenode == '0') ? '<?php echo $_style["tree_folder"]; ?>' : '<?php echo $_style["tree_folder_secure"]; ?>';
}
//rpcNode.innerHTML = '';
rpcNode.style.display = 'none';
openedArray[id] = 0 ;
}
}
function rpcLoadData(response) {

0 comments on commit 45205e4

Please sign in to comment.
You can’t perform that action at this time.