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
3efbff6e
Commit
3efbff6e
authored
Nov 11, 2022
by
Takumi Imai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event.js作成 元はcommon.js
parent
c4640e6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
155 additions
and
156 deletions
+155
-156
abweb/common/js/common.js
+0
-156
abweb/common/js/event.js
+155
-0
No files found.
abweb/common/js/common.js
View file @
3efbff6e
...
...
@@ -1188,159 +1188,3 @@ jQuery.fn.center = function () {
return
this
;
};
$
(
function
()
{
hide_del_btn
();
});
/** Handle press the Add button */
$
(
'.add'
).
on
(
'click'
,
function
()
{
var
base
=
$
(
this
).
parent
().
parent
().
parent
(
'.tb-item'
);
base
.
find
(
'.del'
).
show
();
// clone input form
base
.
clone
(
true
).
insertAfter
(
base
);
// Scroll to added element
$
(
'html,body'
).
animate
({
scrollTop
:
base
.
next
().
offset
().
top
});
// Input form accordion display
base
.
parent
().
parent
(
'.tb'
).
find
(
'.ac-tb-form'
).
show
();
});
/** Handle press the Delete button */
$
(
'.del'
).
on
(
'click'
,
function
()
{
var
base
=
$
(
this
).
parent
().
parent
().
parent
(
'.tb-item'
);
var
tbwrap
=
base
.
parent
(
'.tb-wrap'
);
var
tb
=
tbwrap
.
parent
(
'.tb'
);
// Delete area
base
.
remove
();
// Hidden delete button
hide_del_btn
();
// Form area display switch
tbWrapClear
(
tbwrap
);
// Hide collapse icon
if
(
tb
.
find
(
'.ac-tb-form'
).
is
(
':hidden'
))
{
tb
.
find
(
'.fold-area'
).
addClass
(
'hide'
);
}
});
/** handle Press the close button */
$
(
'.close-window'
).
on
(
'click'
,
function
()
{
window
.
close
();
});
/** Hide delete button when there is only one tablespace form */
function
hide_del_btn
()
{
$
(
'.tb-wrap'
).
each
(
function
(
i
,
elem
)
{
var
len
=
$
(
elem
).
find
(
'.tb-item'
).
length
;
// When there is one item in the table
if
(
len
<=
1
)
{
$
(
elem
).
find
(
'.del'
).
hide
();
$
(
this
).
children
(
'.tb-item'
).
removeClass
(
'visually-hidden'
);
// Input form accordion hidden
$
(
this
).
parent
().
find
(
'.ac-tb-form'
).
hide
();
}
});
}
/** Handle when deleting while closing the accordion */
function
tbWrapClear
(
tbwrap
)
{
// If you delete the form while closing the accordion
// Hide parent element if all child elements are hidden
if
(
tbwrap
.
children
(
':not(.visually-hidden)'
).
length
==
0
)
{
tbwrap
.
addClass
(
'visually-hidden'
);
}
else
{
tbwrap
.
removeClass
(
'visually-hidden'
);
}
}
/** input form accordion */
$
(
'.ac-tb-form'
).
on
(
'click'
,
function
()
{
var
tb
=
$
(
this
).
parent
().
parent
().
parent
(
'.tb'
);
var
elems
=
tb
.
find
(
'.tb-wrap'
).
find
(
'.tb-item'
);
var
tbwrap
=
tb
.
find
(
'.tb-wrap'
);
if
(
!
$
(
this
).
hasClass
(
'hide'
))
{
elems
.
each
(
function
(
i
)
{
i
=
i
+
1
;
if
(
i
!=
elems
.
size
())
{
$
(
this
).
addClass
(
'visually-hidden'
);
}
});
$
(
this
).
text
(
'開く'
);
// Form area display switch
tbWrapClear
(
tbwrap
);
// Collapse icon view
tb
.
find
(
'.fold-area'
).
removeClass
(
'hide'
);
}
else
{
elems
.
removeClass
(
'visually-hidden'
);
$
(
this
).
text
(
'閉じる'
);
// Form area display switch
tbWrapClear
(
tbwrap
);
// Hide collapse icon
tb
.
find
(
'.fold-area'
).
addClass
(
'hide'
);
}
// opening and closing
$
(
this
).
toggleClass
(
'hide'
);
});
/** toggle switch */
$
(
'.toggle'
).
on
(
'click'
,
function
()
{
$
(
this
).
toggleClass
(
'checked'
);
if
(
!
$
(
'input[name="check"]'
).
prop
(
'checked'
))
{
$
(
'.toggle input'
).
prop
(
'checked'
,
true
);
}
else
{
$
(
'.toggle input'
).
prop
(
'checked'
,
false
);
}
});
/** Menu display */
$
(
'.c-dropdown-trigger'
).
on
(
'click'
,
function
()
{
$
(
'[data-target="'
+
$
(
this
).
attr
(
'id'
)
+
'"]'
).
toggleClass
(
'show'
);
$
(
'.mask'
).
removeClass
(
'hide'
);
});
/** Close menu */
$
(
'.mask'
).
on
(
'click'
,
function
()
{
$
(
'.mask'
).
addClass
(
'hide'
);
$
(
'.c-dropdown-menu'
).
removeClass
(
'show'
);
});
/** Select card list */
$
(
'.select-card-list .card .select-label'
).
on
(
'click'
,
function
()
{
$
(
this
).
closest
(
'.select-card-list'
).
find
(
'.card'
).
removeClass
(
'selected'
);
$
(
this
).
closest
(
'.card'
).
addClass
(
'selected'
);
});
/** List display switching (list display) */
$
(
'.view-menu .view-list-btn'
).
on
(
'click'
,
function
()
{
$
(
'.view-block-btn'
).
removeClass
(
'active'
);
$
(
'.view-list-btn'
).
addClass
(
'active'
);
$
(
'.view-content'
).
removeClass
(
'view-block'
);
$
(
'.view-content'
).
addClass
(
'view-list'
);
});
/** List display switching (grid display) */
$
(
'.view-menu .view-block-btn'
).
on
(
'click'
,
function
()
{
$
(
'.view-list-btn'
).
removeClass
(
'active'
);
$
(
'.view-block-btn'
).
addClass
(
'active'
);
$
(
'.view-content'
).
removeClass
(
'view-list'
);
$
(
'.view-content'
).
addClass
(
'view-block'
);
});
/** loading */
$
(
function
()
{
function
e
()
{
setTimeout
(
function
()
{
$
.
LoadingOverlay
(
'hide'
);
},
2000
);
}
$
(
'.search-form-btn'
).
on
(
'click'
,
function
()
{
$
.
LoadingOverlay
(
'show'
,
{
image
:
'img/loading.gif'
,
});
e
();
});
});
abweb/common/js/event.js
0 → 100644
View file @
3efbff6e
$
(
function
()
{
hide_del_btn
();
});
/** Handle press the Add button */
$
(
'.add'
).
on
(
'click'
,
function
()
{
var
base
=
$
(
this
).
parent
().
parent
().
parent
(
'.tb-item'
);
base
.
find
(
'.del'
).
show
();
// clone input form
base
.
clone
(
true
).
insertAfter
(
base
);
// Scroll to added element
$
(
'html,body'
).
animate
({
scrollTop
:
base
.
next
().
offset
().
top
});
// Input form accordion display
base
.
parent
().
parent
(
'.tb'
).
find
(
'.ac-tb-form'
).
show
();
});
/** Handle press the Delete button */
$
(
'.del'
).
on
(
'click'
,
function
()
{
var
base
=
$
(
this
).
parent
().
parent
().
parent
(
'.tb-item'
);
var
tbwrap
=
base
.
parent
(
'.tb-wrap'
);
var
tb
=
tbwrap
.
parent
(
'.tb'
);
// Delete area
base
.
remove
();
// Hidden delete button
hide_del_btn
();
// Form area display switch
tbWrapClear
(
tbwrap
);
// Hide collapse icon
if
(
tb
.
find
(
'.ac-tb-form'
).
is
(
':hidden'
))
{
tb
.
find
(
'.fold-area'
).
addClass
(
'hide'
);
}
});
/** handle Press the close button */
$
(
'.close-window'
).
on
(
'click'
,
function
()
{
window
.
close
();
});
/** Hide delete button when there is only one tablespace form */
function
hide_del_btn
()
{
$
(
'.tb-wrap'
).
each
(
function
(
i
,
elem
)
{
var
len
=
$
(
elem
).
find
(
'.tb-item'
).
length
;
// When there is one item in the table
if
(
len
<=
1
)
{
$
(
elem
).
find
(
'.del'
).
hide
();
$
(
this
).
children
(
'.tb-item'
).
removeClass
(
'visually-hidden'
);
// Input form accordion hidden
$
(
this
).
parent
().
find
(
'.ac-tb-form'
).
hide
();
}
});
}
/** Handle when deleting while closing the accordion */
function
tbWrapClear
(
tbwrap
)
{
// If you delete the form while closing the accordion
// Hide parent element if all child elements are hidden
if
(
tbwrap
.
children
(
':not(.visually-hidden)'
).
length
==
0
)
{
tbwrap
.
addClass
(
'visually-hidden'
);
}
else
{
tbwrap
.
removeClass
(
'visually-hidden'
);
}
}
/** input form accordion */
$
(
'.ac-tb-form'
).
on
(
'click'
,
function
()
{
var
tb
=
$
(
this
).
parent
().
parent
().
parent
(
'.tb'
);
var
elems
=
tb
.
find
(
'.tb-wrap'
).
find
(
'.tb-item'
);
var
tbwrap
=
tb
.
find
(
'.tb-wrap'
);
if
(
!
$
(
this
).
hasClass
(
'hide'
))
{
elems
.
each
(
function
(
i
)
{
i
=
i
+
1
;
if
(
i
!=
elems
.
size
())
{
$
(
this
).
addClass
(
'visually-hidden'
);
}
});
$
(
this
).
text
(
'開く'
);
// Form area display switch
tbWrapClear
(
tbwrap
);
// Collapse icon view
tb
.
find
(
'.fold-area'
).
removeClass
(
'hide'
);
}
else
{
elems
.
removeClass
(
'visually-hidden'
);
$
(
this
).
text
(
'閉じる'
);
// Form area display switch
tbWrapClear
(
tbwrap
);
// Hide collapse icon
tb
.
find
(
'.fold-area'
).
addClass
(
'hide'
);
}
// opening and closing
$
(
this
).
toggleClass
(
'hide'
);
});
/** toggle switch */
$
(
'.toggle'
).
on
(
'click'
,
function
()
{
$
(
this
).
toggleClass
(
'checked'
);
if
(
!
$
(
'input[name="check"]'
).
prop
(
'checked'
))
{
$
(
'.toggle input'
).
prop
(
'checked'
,
true
);
}
else
{
$
(
'.toggle input'
).
prop
(
'checked'
,
false
);
}
});
/** Menu display */
$
(
'.c-dropdown-trigger'
).
on
(
'click'
,
function
()
{
$
(
'[data-target="'
+
$
(
this
).
attr
(
'id'
)
+
'"]'
).
toggleClass
(
'show'
);
$
(
'.mask'
).
removeClass
(
'hide'
);
});
/** Close menu */
$
(
'.mask'
).
on
(
'click'
,
function
()
{
$
(
'.mask'
).
addClass
(
'hide'
);
$
(
'.c-dropdown-menu'
).
removeClass
(
'show'
);
});
/** Select card list */
$
(
'.select-card-list .card .select-label'
).
on
(
'click'
,
function
()
{
$
(
this
).
closest
(
'.select-card-list'
).
find
(
'.card'
).
removeClass
(
'selected'
);
$
(
this
).
closest
(
'.card'
).
addClass
(
'selected'
);
});
/** List display switching (list display) */
$
(
'.view-menu .view-list-btn'
).
on
(
'click'
,
function
()
{
$
(
'.view-block-btn'
).
removeClass
(
'active'
);
$
(
'.view-list-btn'
).
addClass
(
'active'
);
$
(
'.view-content'
).
removeClass
(
'view-block'
);
$
(
'.view-content'
).
addClass
(
'view-list'
);
});
/** List display switching (grid display) */
$
(
'.view-menu .view-block-btn'
).
on
(
'click'
,
function
()
{
$
(
'.view-list-btn'
).
removeClass
(
'active'
);
$
(
'.view-block-btn'
).
addClass
(
'active'
);
$
(
'.view-content'
).
removeClass
(
'view-list'
);
$
(
'.view-content'
).
addClass
(
'view-block'
);
});
/** loading */
$
(
function
()
{
function
e
()
{
setTimeout
(
function
()
{
$
.
LoadingOverlay
(
'hide'
);
},
2000
);
}
$
(
'.search-form-btn'
).
on
(
'click'
,
function
()
{
$
.
LoadingOverlay
(
'show'
,
{
image
:
'img/loading.gif'
,
});
e
();
});
});
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