Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_web
check
Commits
dd73f008
Commit
dd73f008
authored
Jun 26, 2015
by
Masaru Abe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
カテゴリ/グループツリー表示で該当件数が0件なら選択出来ないようにする対応
parent
4bb01134
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
15 deletions
+74
-15
abvw/common/js/jquery.treeview.js
+58
-15
abvw/css/layout/home.css
+12
-0
abvw/css/theme/tab.css
+4
-0
No files found.
abvw/common/js/jquery.treeview.js
View file @
dd73f008
...
@@ -16,6 +16,13 @@
...
@@ -16,6 +16,13 @@
//Add custom i18n.js
//Add custom i18n.js
//名前空間用のオブジェクトを用意する
var
JQ_TREEVIEW
=
{};
JQ_TREEVIEW
.
CLASS_FOLDER
=
"folder"
;
JQ_TREEVIEW
.
CLASS_FOLDER_ZERO
=
"folderZero"
;
JQ_TREEVIEW
.
CLASS_FILE
=
"file"
;
JQ_TREEVIEW
.
CLASS_FILE_ZERO
=
"fileZero"
;
;(
function
(
$
)
{
;(
function
(
$
)
{
// TODO rewrite as a widget, removing all the extra plugins
// TODO rewrite as a widget, removing all the extra plugins
...
@@ -294,6 +301,7 @@ function TreeNode() {
...
@@ -294,6 +301,7 @@ function TreeNode() {
function
AddCategory
(
targetTreeView
,
sourceTreeNode
,
targetTreeNode
,
callbackFunction
)
{
function
AddCategory
(
targetTreeView
,
sourceTreeNode
,
targetTreeNode
,
callbackFunction
)
{
var
branches
;
var
branches
;
var
scriptCallback
=
""
;
var
scriptCallback
=
""
;
var
tmpClass
=
JQ_TREEVIEW
.
CLASS_FOLDER
;
if
(
callbackFunction
!=
undefined
&&
callbackFunction
!=
null
)
{
if
(
callbackFunction
!=
undefined
&&
callbackFunction
!=
null
)
{
...
@@ -307,44 +315,60 @@ function AddCategory(targetTreeView, sourceTreeNode, targetTreeNode, callbackFun
...
@@ -307,44 +315,60 @@ function AddCategory(targetTreeView, sourceTreeNode, targetTreeNode, callbackFun
}
}
if
(
targetTreeNode
!=
undefined
&&
targetTreeNode
!=
null
)
{
if
(
targetTreeNode
!=
undefined
&&
targetTreeNode
!=
null
)
{
if
(
sourceTreeNode
.
IsClosed
==
true
)
{
// Collapse
if
(
sourceTreeNode
.
IsClosed
==
true
)
{
// Collapse
if
(
targetTreeView
.
IsShowTotal
==
true
)
{
// Show total count
if
(
targetTreeView
.
IsShowTotal
==
true
&&
sourceTreeNode
.
ContentCount
>
0
)
{
// Show total count
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder' "
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder' "
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
}
}
else
{
else
{
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder' "
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
if
(
sourceTreeNode
.
ContentCount
==
0
){
scriptCallback
=
""
;
tmpClass
=
JQ_TREEVIEW
.
CLASS_FOLDER_ZERO
;
}
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='"
+
tmpClass
+
"' "
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
}
}
}
}
else
{
else
{
if
(
targetTreeView
.
IsShowTotal
==
true
)
{
// Show total count
if
(
targetTreeView
.
IsShowTotal
==
true
&&
sourceTreeNode
.
ContentCount
>
0
)
{
// Show total count
branches
=
$
(
"<li ><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
branches
=
$
(
"<li ><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
}
}
else
{
else
{
branches
=
$
(
"<li ><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
if
(
sourceTreeNode
.
ContentCount
==
0
){
scriptCallback
=
""
;
tmpClass
=
JQ_TREEVIEW
.
CLASS_FOLDER_ZERO
;
}
branches
=
$
(
"<li ><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='"
+
tmpClass
+
"'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
}
}
}
}
}
}
else
{
else
{
if
(
sourceTreeNode
.
IsClosed
==
true
)
{
// Collapse
if
(
sourceTreeNode
.
IsClosed
==
true
)
{
// Collapse
if
(
targetTreeView
.
IsShowTotal
==
true
)
{
// Show total count
if
(
targetTreeView
.
IsShowTotal
==
true
&&
sourceTreeNode
.
ContentCount
>
0
)
{
// Show total count
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
else
{
else
{
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
if
(
sourceTreeNode
.
ContentCount
==
0
){
scriptCallback
=
""
;
tmpClass
=
JQ_TREEVIEW
.
CLASS_FOLDER_ZERO
;
}
branches
=
$
(
"<li class='closed'><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='"
+
tmpClass
+
"'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
}
}
else
{
else
{
if
(
targetTreeView
.
IsShowTotal
==
true
)
{
// Show total count
if
(
targetTreeView
.
IsShowTotal
==
true
&&
sourceTreeNode
.
ContentCount
>
0
)
{
// Show total count
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNode
.
ContentCount
+
")<ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
else
{
else
{
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='folder'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
if
(
sourceTreeNode
.
ContentCount
==
0
){
scriptCallback
=
""
;
tmpClass
=
JQ_TREEVIEW
.
CLASS_FOLDER_ZERO
;
}
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='"
+
tmpClass
+
"'"
+
scriptCallback
+
">"
+
sourceTreeNode
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"><ul id='"
+
sourceTreeNode
.
Id
+
"'>"
+
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
"</ul></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
}
}
...
@@ -362,8 +386,8 @@ function AddCategory(targetTreeView, sourceTreeNode, targetTreeNode, callbackFun
...
@@ -362,8 +386,8 @@ function AddCategory(targetTreeView, sourceTreeNode, targetTreeNode, callbackFun
// Add item
// Add item
function
AddItem
(
targetTreeView
,
sourceTreeNodeItem
,
targetTreeNode
,
callbackFunction
)
{
function
AddItem
(
targetTreeView
,
sourceTreeNodeItem
,
targetTreeNode
,
callbackFunction
)
{
var
branches
;
var
branches
;
var
scriptCallback
=
""
;
var
scriptCallback
=
""
;
var
tmpClass
=
JQ_TREEVIEW
.
CLASS_FILE
;
if
(
callbackFunction
!=
undefined
&&
callbackFunction
!=
null
)
{
if
(
callbackFunction
!=
undefined
&&
callbackFunction
!=
null
)
{
scriptCallback
+=
' id="'
+
sourceTreeNodeItem
.
Id
+
'"'
;
scriptCallback
+=
' id="'
+
sourceTreeNodeItem
.
Id
+
'"'
;
...
@@ -379,28 +403,46 @@ function AddItem(targetTreeView, sourceTreeNodeItem, targetTreeNode, callbackFun
...
@@ -379,28 +403,46 @@ function AddItem(targetTreeView, sourceTreeNodeItem, targetTreeNode, callbackFun
if
(
targetTreeNode
!=
undefined
&&
targetTreeNode
!=
null
)
{
if
(
targetTreeNode
!=
undefined
&&
targetTreeNode
!=
null
)
{
// Nodes of root
// Nodes of root
if
(
targetTreeView
.
IsShowTotal
==
true
)
{
if
(
targetTreeView
.
IsShowTotal
==
true
&&
sourceTreeNodeItem
.
ContentCount
>
0
)
{
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" class='file'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNodeItem
.
ContentCount
+
")</li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" class='file'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNodeItem
.
ContentCount
+
")</li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
}
}
else
{
else
{
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" class='file'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> </li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
if
(
sourceTreeNodeItem
.
ContentCount
==
0
){
if
(
callbackFunction
!=
undefined
&&
callbackFunction
!=
null
)
{
scriptCallback
=
' id="'
+
sourceTreeNodeItem
.
Id
+
'"'
;
}
tmpClass
=
JQ_TREEVIEW
.
CLASS_FILE_ZERO
;
}
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" class='"
+
tmpClass
+
"'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> </li>"
).
appendTo
(
"#"
+
targetTreeNode
.
Id
);
}
}
}
}
else
{
else
{
if
(
sourceTreeNodeItem
.
Id
==
"all"
)
{
// All nodes
if
(
sourceTreeNodeItem
.
Id
==
"all"
)
{
// All nodes
if
(
targetTreeView
.
IsShowTotal
==
true
)
{
if
(
targetTreeView
.
IsShowTotal
==
true
&&
targetTreeView
.
TotalCount
>
0
)
{
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='file lang root' lang='txtAll'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
targetTreeView
.
TotalCount
+
")</li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='file lang root' lang='txtAll'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
targetTreeView
.
TotalCount
+
")</li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
else
{
else
{
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='file lang root' lang='txtAll'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
if
(
targetTreeView
.
TotalCount
==
0
){
if
(
callbackFunction
!=
undefined
&&
callbackFunction
!=
null
)
{
scriptCallback
=
' id="'
+
sourceTreeNodeItem
.
Id
+
'"'
;
}
tmpClass
=
JQ_TREEVIEW
.
CLASS_FILE_ZERO
;
}
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='"
+
tmpClass
+
" lang root' lang='txtAll'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
}
}
else
{
// Node of root but not be "all node"
else
{
// Node of root but not be "all node"
if
(
targetTreeView
.
IsShowTotal
==
true
)
{
if
(
targetTreeView
.
IsShowTotal
==
true
&&
sourceTreeNodeItem
.
TotalCount
>
0
)
{
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='file'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNodeItem
.
ContentCount
+
")</li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='file'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"> ("
+
sourceTreeNodeItem
.
ContentCount
+
")</li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
else
{
else
{
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='file'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
if
(
sourceTreeNodeItem
.
TotalCount
==
0
){
if
(
callbackFunction
!=
undefined
&&
callbackFunction
!=
null
)
{
scriptCallback
=
' id="'
+
sourceTreeNodeItem
.
Id
+
'"'
;
}
tmpClass
=
JQ_TREEVIEW
.
CLASS_FILE_ZERO
;
}
branches
=
$
(
"<li><"
+
targetTreeView
.
CategoryTagName
+
" style='padding-left: 5px;' class='"
+
tmpClass
+
"'"
+
scriptCallback
+
">"
+
sourceTreeNodeItem
.
Text
+
"</"
+
targetTreeView
.
CategoryTagName
+
"></li>"
).
appendTo
(
"#"
+
targetTreeView
.
Id
);
}
}
}
}
}
}
...
@@ -520,6 +562,7 @@ function TreeView() {
...
@@ -520,6 +562,7 @@ function TreeView() {
newItem
.
Id
=
"all"
;
newItem
.
Id
=
"all"
;
newItem
.
IsCategory
=
false
;
newItem
.
IsCategory
=
false
;
newItem
.
ContentCount
=
this
.
TotalCount
;
newItem
.
ContentCount
=
this
.
TotalCount
;
AddItem
(
tree
,
newItem
,
null
,
callbackFunctionName
);
AddItem
(
tree
,
newItem
,
null
,
callbackFunctionName
);
if
(
nodes
!=
undefined
&&
nodes
!=
null
)
{
if
(
nodes
!=
undefined
&&
nodes
!=
null
)
{
...
...
abvw/css/layout/home.css
View file @
dd73f008
...
@@ -71,6 +71,18 @@ a:hover{
...
@@ -71,6 +71,18 @@ a:hover{
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.folderZero
,
.fileZero
{
padding-left
:
5px
;
}
a
.folderZero
:hover
{
cursor
:
default
;
}
a
.fileZero
:hover
{
cursor
:
default
;
}
.sectionhomebookshelf
a
.name
{
}
.sectionhomebookshelf
a
.name
{
}
/* hibiya */
/* hibiya */
...
...
abvw/css/theme/tab.css
View file @
dd73f008
...
@@ -62,6 +62,10 @@
...
@@ -62,6 +62,10 @@
font-size
:
12px
;
font-size
:
12px
;
text-decoration
:
none
;
text-decoration
:
none
;
}
}
/*
.tabUnit .tabUnitList ul li a:hover{ text-decoration:underline;}
.tabUnit .tabUnitList ul li a:hover{ text-decoration:underline;}
*/
.tabUnit
.tabUnitList
ul
li
a
.folder
:hover
{
text-decoration
:
underline
;}
.tabUnit
.tabUnitList
ul
li
a
.file
:hover
{
text-decoration
:
underline
;}
.sankaku_left
{
}
.sankaku_left
{
}
.sankaku_right
{
}
.sankaku_right
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment